From 0e31bcaa686ee41420525f579a597048e10c89a1 Mon Sep 17 00:00:00 2001 From: axiomlogicnexus Date: Wed, 29 Apr 2026 05:02:32 +0200 Subject: [PATCH] Explain drill-recovery stance in coaching output --- .../HyperTwistTrainingCoachLibrary.cpp | 132 ++++++++++++++++-- 1 file changed, 121 insertions(+), 11 deletions(-) diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp index 2fa34b5..f5d8bb6 100644 --- a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingCoachLibrary.cpp @@ -59,6 +59,37 @@ namespace HyperTwistTrainingCoachLibraryInternal || SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-weak"); } + bool IsStrongMethodDrillRecoveryMemorySource(const FString& SourceLabel) + { + return SourceLabel.StartsWith(TEXT("coach-memory-dashboard-method-drill-recovery-strong-")) + || SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-strong-queued") + || SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-strong-follow-up") + || SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-strong-recommended") + || SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-strong"); + } + + bool IsWeakMethodDrillRecoveryMemorySource(const FString& SourceLabel) + { + return SourceLabel.StartsWith(TEXT("coach-memory-dashboard-method-drill-recovery-weak-")) + || SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-weak-queued") + || SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-weak-follow-up") + || SourceLabel == TEXT("dashboard-handoff-method-drill-recovery-weak-recommended") + || SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-weak"); + } + + FString DescribeRetainedMethodDrillRecoveryStanceLabel(const FString& SourceLabel) + { + if (IsStrongMethodDrillRecoveryMemorySource(SourceLabel)) + { + return TEXT("strong retained drill-recovery continuation"); + } + if (IsWeakMethodDrillRecoveryMemorySource(SourceLabel)) + { + return TEXT("weak retained drill-recovery redirect"); + } + return TEXT("none"); + } + FString DescribeCoachHandoffKind(const EHyperTwistTrainingCoachHandoffKind HandoffKind) { switch (HandoffKind) @@ -1195,6 +1226,14 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna HyperTwistTrainingCoachLibraryInternal::IsMethodDrillDashboardHandoffSource( CoachMemorySnapshot.PreferredCoachHandoffSourceLabel ); + const bool bStrongMethodDrillDashboardHandoff = + HyperTwistTrainingCoachLibraryInternal::IsStrongMethodDrillRecoveryMemorySource( + CoachMemorySnapshot.PreferredCoachHandoffSourceLabel + ); + const bool bWeakMethodDrillDashboardHandoff = + HyperTwistTrainingCoachLibraryInternal::IsWeakMethodDrillRecoveryMemorySource( + CoachMemorySnapshot.PreferredCoachHandoffSourceLabel + ); const bool bExplicitDashboardHandoffPreference = CoachMemorySnapshot.PreferredCoachHandoffKind != EHyperTwistTrainingCoachHandoffKind::None; const bool bQueueRecoverySource = @@ -1216,6 +1255,14 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna HyperTwistTrainingCoachLibraryInternal::IsMethodDrillRecoveryMemorySource( CoachMemorySnapshot.PreferredQueueRecoveryActionSourceLabel ); + const bool bStrongMethodDrillRecoveryActionSource = + HyperTwistTrainingCoachLibraryInternal::IsStrongMethodDrillRecoveryMemorySource( + CoachMemorySnapshot.PreferredQueueRecoveryActionSourceLabel + ); + const bool bWeakMethodDrillRecoveryActionSource = + HyperTwistTrainingCoachLibraryInternal::IsWeakMethodDrillRecoveryMemorySource( + CoachMemorySnapshot.PreferredQueueRecoveryActionSourceLabel + ); const float Score = 66.0f + FMath::Min(CoachMemorySnapshot.ScheduleExecutionPressureScore * 0.25f, 20.0f) + (bArchiveAware ? 5.0f : 0.0f) @@ -1232,7 +1279,11 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna FString Headline; if (bDashboardQueuedHandoff) { - Headline = bMethodDrillDashboardHandoff + Headline = bStrongMethodDrillDashboardHandoff + ? (bPromoteQueueRecovery + ? TEXT("Accepted strong retained drill-recovery queued handoffs keep the queue-first continuation slice active") + : TEXT("Accepted strong retained drill-recovery queued handoffs favor a queue-first continuation launch")) + : (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")) @@ -1242,11 +1293,15 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna : 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 = bMethodDrillDashboardHandoff + Headline = bStrongMethodDrillDashboardHandoff + ? (bPromoteQueueRecovery + ? TEXT("Accepted strong retained drill-recovery follow-up handoffs keep the narrowed continuation lane active") + : TEXT("Accepted strong retained drill-recovery follow-up handoffs favor recovering the narrowed continuation lane next")) + : (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")) @@ -1256,11 +1311,15 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna : 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 = bMethodDrillDashboardHandoff + Headline = bWeakMethodDrillDashboardHandoff + ? (bPromoteQueueRecovery + ? TEXT("Accepted weak retained drill-recovery history keeps broader recommended redirect work active") + : TEXT("Accepted weak retained drill-recovery history favors a broader recommended redirect next")) + : (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")) @@ -1270,27 +1329,35 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna : 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 = bMethodDrillRecoveryActionSource + Headline = bStrongMethodDrillRecoveryActionSource + ? (bPromoteQueueRecovery + ? TEXT("Promote the strong retained drill-recovery continuation lane back into active queue flow") + : TEXT("Recover the strong retained drill-recovery continuation lane before the queue drifts further")) + : (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")); + : TEXT("Recover the deferred follow-up lane before the queue drifts further"))); } else if (bQueueRecoveryRecommended) { - Headline = bMethodDrillRecoveryActionSource + Headline = bWeakMethodDrillRecoveryActionSource + ? (bPromoteQueueRecovery + ? TEXT("Promote the weak retained drill-recovery redirect lane back into the active queue") + : TEXT("Recover the weak retained drill-recovery redirect lane and restore queue cadence")) + : (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")); + : TEXT("Recover the deferred recommended lane and restore queue cadence"))); } else if (bBlockedFollowUp) { @@ -1337,6 +1404,11 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna ? TEXT("none") : HyperTwistTrainingCoachLibraryInternal::DescribeCoachMemorySourceLabel( CoachMemorySnapshot.PreferredCoachHandoffSourceLabel); + const FString RetainedMethodDrillRecoveryStanceLabel = + HyperTwistTrainingCoachLibraryInternal::DescribeRetainedMethodDrillRecoveryStanceLabel( + !CoachMemorySnapshot.PreferredCoachHandoffSourceLabel.IsEmpty() + ? CoachMemorySnapshot.PreferredCoachHandoffSourceLabel + : CoachMemorySnapshot.PreferredQueueRecoveryActionSourceLabel); const FString SignalId = bQueueRecoveryFollowUp ? (bPromoteQueueRecovery ? TEXT("schedule_friction_follow_up_promote_recovery") @@ -1370,7 +1442,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, methodDrillHandoff=%d, methodDrillRecoverySource=%d"), + TEXT("deferred=%d, manual=%d, archiveAware=%d, blockedFollowUp=%d, completionGap=%d, deferralReason=%s, recoverySource=%s, recoveryAction=%s, recoveryActionSource=%s, handoffPreference=%s, handoffSource=%s, retainedMethodDrillRecoveryStance=%s, deferredOverflowHandoff=%d, methodDrillHandoff=%d, methodDrillRecoverySource=%d"), CoachMemorySnapshot.ScheduleDeferredEventCount, CoachMemorySnapshot.ScheduleManualRescheduleEventCount, CoachMemorySnapshot.ScheduleArchiveAwareEventCount, @@ -1382,6 +1454,7 @@ TArray UHyperTwistTrainingCoachLibrary::DeriveCoachSigna *RecoveryActionSourceLabel, *HandoffPreferenceLabel, *HandoffSourceLabel, + *RetainedMethodDrillRecoveryStanceLabel, bTightenedDeferredOverflowHandoff ? 1 : 0, bMethodDrillDashboardHandoff ? 1 : 0, bMethodDrillRecoveryActionSource ? 1 : 0), @@ -2107,6 +2180,32 @@ FHyperTwistCoachSessionQueueSummary UHyperTwistTrainingCoachLibrary::DeriveCoach && CoachMemorySnapshot.PreferredCoachHandoffKind == EHyperTwistTrainingCoachHandoffKind::Recommended && SourceLabel == TEXT("primary-brief"); + const bool bStrongRetainedMethodDrillRecoveryContinuation = + HyperTwistTrainingCoachLibraryInternal::IsStrongMethodDrillRecoveryMemorySource( + CoachMemorySnapshot.PreferredCoachHandoffSourceLabel + ) + && ((CoachMemorySnapshot.PreferredCoachHandoffKind + == EHyperTwistTrainingCoachHandoffKind::Queue + && Brief.bNeedsDeferredLaunchRecovery) + || (CoachMemorySnapshot.PreferredCoachHandoffKind + == EHyperTwistTrainingCoachHandoffKind::FollowUp + && SourceLabel == TEXT("follow-up-brief")) + || (CoachMemorySnapshot.PreferredCoachHandoffKind + == EHyperTwistTrainingCoachHandoffKind::Recommended + && SourceLabel == TEXT("primary-brief"))); + const bool bWeakRetainedMethodDrillRecoveryRedirect = + HyperTwistTrainingCoachLibraryInternal::IsWeakMethodDrillRecoveryMemorySource( + CoachMemorySnapshot.PreferredCoachHandoffSourceLabel + ) + && ((CoachMemorySnapshot.PreferredCoachHandoffKind + == EHyperTwistTrainingCoachHandoffKind::Queue + && Brief.bNeedsDeferredLaunchRecovery) + || (CoachMemorySnapshot.PreferredCoachHandoffKind + == EHyperTwistTrainingCoachHandoffKind::FollowUp + && SourceLabel == TEXT("follow-up-brief")) + || (CoachMemorySnapshot.PreferredCoachHandoffKind + == EHyperTwistTrainingCoachHandoffKind::Recommended + && SourceLabel == TEXT("primary-brief"))); if (bNarrowedQueueContinuation || bNarrowedFollowUpContinuation || bNarrowedRecommendedContinuation) @@ -2128,6 +2227,17 @@ FHyperTwistCoachSessionQueueSummary UHyperTwistTrainingCoachLibrary::DeriveCoach *ContinuationLabel ); } + if (bStrongRetainedMethodDrillRecoveryContinuation + || bWeakRetainedMethodDrillRecoveryRedirect) + { + Entry.Headline = FString::Printf( + TEXT("%s (%s)"), + *Entry.Headline, + bStrongRetainedMethodDrillRecoveryContinuation + ? TEXT("strong retained drill-recovery continuation") + : TEXT("weak retained drill-recovery redirect") + ); + } if (CoachMemorySnapshot.PreferredLaunchBudgetBias != 0 && (CoachMemorySnapshot.BroadenedLaunchBudgetHistoryCount > 0 || CoachMemorySnapshot.TightenedLaunchBudgetHistoryCount > 0))