From 262079e12844578809389f9f1ba8dc805ccad83d Mon Sep 17 00:00:00 2001 From: axiomlogicnexus Date: Wed, 29 Apr 2026 20:23:24 +0200 Subject: [PATCH] Strengthen reliable drill recovery plan defaults --- .../HyperTwistCoachDashboardWidget.cpp | 64 +++++++++++++++++- .../HyperTwistTrainingRepositoryLibrary.cpp | 66 +++++++++++++++++-- .../HyperTwistCoachDashboardWidget.h | 2 + 3 files changed, 125 insertions(+), 7 deletions(-) diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistCoachDashboardWidget.cpp b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistCoachDashboardWidget.cpp index f7decc0..ada7b32 100644 --- a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistCoachDashboardWidget.cpp +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistCoachDashboardWidget.cpp @@ -1917,7 +1917,7 @@ namespace HyperTwistCoachDashboardWidgetInternal Entry.PreferredRecoveryActionSourceLabel)) { ++Summary.ReliableTrustedTightPlanSourceCount; - if (Entry.bGeneratedPlanUsedTightStructureContinuationPosture) + if (Entry.bGeneratedPlanUsedReliableTrustedTightStructureContinuationPosture) { ++Summary.ReliableTrustedTightPlanAlignedCount; } @@ -1944,7 +1944,7 @@ namespace HyperTwistCoachDashboardWidgetInternal Entry.PreferredRecoveryActionSourceLabel)) { ++Summary.ReliableTrustedBroadPlanSourceCount; - if (Entry.bGeneratedPlanUsedBroadStructureRedirectPosture) + if (Entry.bGeneratedPlanUsedReliableTrustedBroadStructureRedirectPosture) { ++Summary.ReliableTrustedBroadPlanAlignedCount; } @@ -1964,6 +1964,17 @@ namespace HyperTwistCoachDashboardWidgetInternal { if (IsTightMethodDrillRecoveryPlanSourceLabel(Entry.PreferredRecoveryActionSourceLabel)) { + 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 @@ -1972,6 +1983,17 @@ namespace HyperTwistCoachDashboardWidgetInternal } if (IsBroadMethodDrillRecoveryPlanSourceLabel(Entry.PreferredRecoveryActionSourceLabel)) { + 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 @@ -7898,6 +7920,8 @@ void UHyperTwistCoachDashboardWidget::RecordMethodDrillRecoveryMemoryHistorySnap const FString GuidanceSourceLabel = CachedCoachPanelState.PreferredGuidanceSourceLabel; const auto ApplyGeneratedPlanSnapshot = [&Entry]( + const bool bUseReliableTrustedTightPlanSource, + const bool bUseReliableTrustedBroadPlanSource, const EHyperTwistTrainingDeliveryMode SuggestedMode, const EHyperTwistTrainingSelectionPolicy SuggestedSelectionPolicy) { @@ -7917,6 +7941,16 @@ void UHyperTwistCoachDashboardWidget::RecordMethodDrillRecoveryMemoryHistorySnap && HyperTwistCoachDashboardWidgetInternal::IsBroadCoachPlanPosture( SuggestedMode, SuggestedSelectionPolicy); + Entry.bGeneratedPlanUsedReliableTrustedTightStructureContinuationPosture = + bUseReliableTrustedTightPlanSource + && HyperTwistCoachDashboardWidgetInternal::IsTightCoachPlanPosture( + SuggestedMode, + SuggestedSelectionPolicy); + Entry.bGeneratedPlanUsedReliableTrustedBroadStructureRedirectPosture = + bUseReliableTrustedBroadPlanSource + && HyperTwistCoachDashboardWidgetInternal::IsBroadCoachPlanPosture( + SuggestedMode, + SuggestedSelectionPolicy); }; const bool bStrongPacketPosture = SourceUsesStrongRetainedMethodDrillRecoveryPosture(GuidanceSourceLabel) @@ -7937,6 +7971,16 @@ void UHyperTwistCoachDashboardWidget::RecordMethodDrillRecoveryMemoryHistorySnap Entry.PreferredRecoveryActionSourceLabel ) ); + const bool bReliableTrustedTightPlanSource = + HyperTwistCoachDashboardWidgetInternal::IsReliableTrustedTightMethodDrillRecoveryPlanSourceLabel( + GuidanceSourceLabel) + || HyperTwistCoachDashboardWidgetInternal::IsReliableTrustedTightMethodDrillRecoveryPlanSourceLabel( + Entry.PreferredRecoveryActionSourceLabel); + const bool bReliableTrustedBroadPlanSource = + HyperTwistCoachDashboardWidgetInternal::IsReliableTrustedBroadMethodDrillRecoveryPlanSourceLabel( + GuidanceSourceLabel) + || HyperTwistCoachDashboardWidgetInternal::IsReliableTrustedBroadMethodDrillRecoveryPlanSourceLabel( + Entry.PreferredRecoveryActionSourceLabel); Entry.bGeneratedPacketUsedStrongRetainedMethodDrillRecoveryPosture = bStrongPacketPosture; Entry.bGeneratedPacketUsedWeakRetainedMethodDrillRecoveryPosture = bWeakPacketPosture; Entry.bGeneratedPacketUsedGenericMethodDrillRecoveryMemory = bGenericRecoveryPacket; @@ -7954,6 +7998,8 @@ void UHyperTwistCoachDashboardWidget::RecordMethodDrillRecoveryMemoryHistorySnap : SelectedQueueEntry->Headline; Entry.GeneratedGuidancePacketFocusCaseCount = SelectedQueueEntry->FocusCaseIds.Num(); ApplyGeneratedPlanSnapshot( + bReliableTrustedTightPlanSource, + bReliableTrustedBroadPlanSource, SelectedQueueEntry->SuggestedMode, SelectedQueueEntry->SuggestedSelectionPolicy); } @@ -7966,6 +8012,8 @@ void UHyperTwistCoachDashboardWidget::RecordMethodDrillRecoveryMemoryHistorySnap Entry.GeneratedGuidancePacketActionLabel = CachedCoachFollowUpBrief.PrimaryActionLabel; Entry.GeneratedGuidancePacketFocusCaseCount = CachedCoachFollowUpBrief.FocusCaseIds.Num(); ApplyGeneratedPlanSnapshot( + bReliableTrustedTightPlanSource, + bReliableTrustedBroadPlanSource, CachedCoachFollowUpBrief.SuggestedMode, CachedCoachFollowUpBrief.SuggestedSelectionPolicy); } @@ -7977,6 +8025,8 @@ void UHyperTwistCoachDashboardWidget::RecordMethodDrillRecoveryMemoryHistorySnap Entry.GeneratedGuidancePacketActionLabel = CachedCoachBrief.PrimaryActionLabel; Entry.GeneratedGuidancePacketFocusCaseCount = CachedCoachBrief.FocusCaseIds.Num(); ApplyGeneratedPlanSnapshot( + bReliableTrustedTightPlanSource, + bReliableTrustedBroadPlanSource, CachedCoachBrief.SuggestedMode, CachedCoachBrief.SuggestedSelectionPolicy); } @@ -7992,6 +8042,8 @@ void UHyperTwistCoachDashboardWidget::RecordMethodDrillRecoveryMemoryHistorySnap Entry.GeneratedGuidancePacketActionLabel = CachedCoachFollowUpBrief.PrimaryActionLabel; Entry.GeneratedGuidancePacketFocusCaseCount = CachedCoachFollowUpBrief.FocusCaseIds.Num(); ApplyGeneratedPlanSnapshot( + bReliableTrustedTightPlanSource, + bReliableTrustedBroadPlanSource, CachedCoachFollowUpBrief.SuggestedMode, CachedCoachFollowUpBrief.SuggestedSelectionPolicy); } @@ -8007,6 +8059,8 @@ void UHyperTwistCoachDashboardWidget::RecordMethodDrillRecoveryMemoryHistorySnap : SelectedQueueEntry->Headline; Entry.GeneratedGuidancePacketFocusCaseCount = SelectedQueueEntry->FocusCaseIds.Num(); ApplyGeneratedPlanSnapshot( + bReliableTrustedTightPlanSource, + bReliableTrustedBroadPlanSource, SelectedQueueEntry->SuggestedMode, SelectedQueueEntry->SuggestedSelectionPolicy); } @@ -8020,6 +8074,8 @@ void UHyperTwistCoachDashboardWidget::RecordMethodDrillRecoveryMemoryHistorySnap Entry.GeneratedGuidancePacketActionLabel = CachedCoachBrief.PrimaryActionLabel; Entry.GeneratedGuidancePacketFocusCaseCount = CachedCoachBrief.FocusCaseIds.Num(); ApplyGeneratedPlanSnapshot( + bReliableTrustedTightPlanSource, + bReliableTrustedBroadPlanSource, CachedCoachBrief.SuggestedMode, CachedCoachBrief.SuggestedSelectionPolicy); } @@ -8115,6 +8171,10 @@ void UHyperTwistCoachDashboardWidget::RecordMethodDrillRecoveryMemoryHistorySnap == Entry.bGeneratedPlanUsedTightStructureContinuationPosture && MethodDrillRecoveryMemoryHistoryEntries.Last().bGeneratedPlanUsedBroadStructureRedirectPosture == Entry.bGeneratedPlanUsedBroadStructureRedirectPosture + && MethodDrillRecoveryMemoryHistoryEntries.Last().bGeneratedPlanUsedReliableTrustedTightStructureContinuationPosture + == Entry.bGeneratedPlanUsedReliableTrustedTightStructureContinuationPosture + && MethodDrillRecoveryMemoryHistoryEntries.Last().bGeneratedPlanUsedReliableTrustedBroadStructureRedirectPosture + == Entry.bGeneratedPlanUsedReliableTrustedBroadStructureRedirectPosture && MethodDrillRecoveryMemoryHistoryEntries.Last().bUsedMethodDrillRecoveryMemoryForRecovery == Entry.bUsedMethodDrillRecoveryMemoryForRecovery && MethodDrillRecoveryMemoryHistoryEntries.Last().bUsedMethodDrillRecoveryMemoryForHandoff diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp index e77d288..3f3bf02 100644 --- a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp @@ -1894,6 +1894,12 @@ namespace HyperTwistTrainingRepositoryLibraryInternal == TEXT("coach-memory-method-drill-recovery-structure-plan-tight-trusted") || CoachMemorySnapshot.PreferredQueueRecoveryActionSourceLabel == TEXT("coach-memory-method-drill-recovery-structure-plan-tight-trusted-reliable"); + const bool bReliableTrustedTightMethodDrillRecoveryStructurePlanHandoffSource = + HyperTwistTrainingRepositoryLibraryInternal::IsReliableTrustedTightMethodDrillRecoveryStructurePlanDashboardHandoffSource( + CoachMemorySnapshot.PreferredCoachHandoffSourceLabel + ) + || CoachMemorySnapshot.PreferredQueueRecoveryActionSourceLabel + == TEXT("coach-memory-method-drill-recovery-structure-plan-tight-trusted-reliable"); const bool bBroadMethodDrillRecoveryStructureHandoffSource = HyperTwistTrainingRepositoryLibraryInternal::IsBroadMethodDrillRecoveryStructureDashboardHandoffSource( CoachMemorySnapshot.PreferredCoachHandoffSourceLabel @@ -1910,6 +1916,12 @@ namespace HyperTwistTrainingRepositoryLibraryInternal == TEXT("coach-memory-method-drill-recovery-structure-plan-broad-trusted") || CoachMemorySnapshot.PreferredQueueRecoveryActionSourceLabel == TEXT("coach-memory-method-drill-recovery-structure-plan-broad-trusted-reliable"); + const bool bReliableTrustedBroadMethodDrillRecoveryStructurePlanHandoffSource = + HyperTwistTrainingRepositoryLibraryInternal::IsReliableTrustedBroadMethodDrillRecoveryStructurePlanDashboardHandoffSource( + CoachMemorySnapshot.PreferredCoachHandoffSourceLabel + ) + || CoachMemorySnapshot.PreferredQueueRecoveryActionSourceLabel + == TEXT("coach-memory-method-drill-recovery-structure-plan-broad-trusted-reliable"); const bool bStrongMethodDrillRecoveryMemoryHandoffSource = CoachMemorySnapshot.PreferredCoachHandoffSourceLabel.StartsWith( TEXT("coach-memory-dashboard-method-drill-recovery-strong-")) @@ -1945,8 +1957,18 @@ namespace HyperTwistTrainingRepositoryLibraryInternal { InOutMode = EHyperTwistTrainingDeliveryMode::CoachReviewed; } + else if (bReliableTrustedTightMethodDrillRecoveryStructurePlanHandoffSource + && InOutMode != EHyperTwistTrainingDeliveryMode::CoachReviewed + && InOutMode != EHyperTwistTrainingDeliveryMode::RecognitionAssisted) + { + InOutMode = EHyperTwistTrainingDeliveryMode::CoachReviewed; + } - if (bNarrowMethodDrillRecoveryStructureHandoffSource + if (bReliableTrustedTightMethodDrillRecoveryStructurePlanHandoffSource) + { + InOutSelectionPolicy = EHyperTwistTrainingSelectionPolicy::Scripted; + } + else if (bNarrowMethodDrillRecoveryStructureHandoffSource && InOutSelectionPolicy != EHyperTwistTrainingSelectionPolicy::Scripted) { InOutSelectionPolicy = EHyperTwistTrainingSelectionPolicy::Scripted; @@ -1999,8 +2021,18 @@ namespace HyperTwistTrainingRepositoryLibraryInternal { InOutMode = EHyperTwistTrainingDeliveryMode::CoachReviewed; } + else if (bReliableTrustedTightMethodDrillRecoveryStructurePlanHandoffSource + && InOutMode != EHyperTwistTrainingDeliveryMode::CoachReviewed + && InOutMode != EHyperTwistTrainingDeliveryMode::RecognitionAssisted) + { + InOutMode = EHyperTwistTrainingDeliveryMode::CoachReviewed; + } - if (InOutSelectionPolicy == EHyperTwistTrainingSelectionPolicy::Weighted) + if (bReliableTrustedTightMethodDrillRecoveryStructurePlanHandoffSource) + { + InOutSelectionPolicy = EHyperTwistTrainingSelectionPolicy::Scripted; + } + else if (InOutSelectionPolicy == EHyperTwistTrainingSelectionPolicy::Weighted) { InOutSelectionPolicy = EHyperTwistTrainingSelectionPolicy::Scripted; } @@ -2099,7 +2131,8 @@ namespace HyperTwistTrainingRepositoryLibraryInternal CoachBrief.FollowUpDepth > 0 || CoachBrief.bNeedsCoachReview || CoachMemorySnapshot.FollowUpReadyCoachSequenceCount > 0 - || CoachMemorySnapshot.ScheduleBlockedFollowUpEventCount > 0; + || CoachMemorySnapshot.ScheduleBlockedFollowUpEventCount > 0 + || bReliableTrustedTightMethodDrillRecoveryStructurePlanHandoffSource; if (!bShouldBiasFollowUpDefaults) { return; @@ -2115,8 +2148,18 @@ namespace HyperTwistTrainingRepositoryLibraryInternal { InOutMode = EHyperTwistTrainingDeliveryMode::CoachReviewed; } + else if (bReliableTrustedTightMethodDrillRecoveryStructurePlanHandoffSource + && InOutMode != EHyperTwistTrainingDeliveryMode::CoachReviewed + && InOutMode != EHyperTwistTrainingDeliveryMode::RecognitionAssisted) + { + InOutMode = EHyperTwistTrainingDeliveryMode::CoachReviewed; + } - if (InOutSelectionPolicy == EHyperTwistTrainingSelectionPolicy::Weighted) + if (bReliableTrustedTightMethodDrillRecoveryStructurePlanHandoffSource) + { + InOutSelectionPolicy = EHyperTwistTrainingSelectionPolicy::Scripted; + } + else if (InOutSelectionPolicy == EHyperTwistTrainingSelectionPolicy::Weighted) { InOutSelectionPolicy = EHyperTwistTrainingSelectionPolicy::Scripted; } @@ -2135,13 +2178,26 @@ namespace HyperTwistTrainingRepositoryLibraryInternal { InOutMode = EHyperTwistTrainingDeliveryMode::RecognitionAssisted; } + else if (bReliableTrustedBroadMethodDrillRecoveryStructurePlanHandoffSource + && CoachMemorySnapshot.DominantCoachSuggestedMode + != EHyperTwistTrainingDeliveryMode::CoachReviewed) + { + InOutMode = CoachMemorySnapshot.DominantCoachSuggestedMode; + } else if (InOutMode == EHyperTwistTrainingDeliveryMode::CoachReviewed && CoachMemorySnapshot.DominantCoachSuggestedMode != EHyperTwistTrainingDeliveryMode::CoachReviewed) { InOutMode = CoachMemorySnapshot.DominantCoachSuggestedMode; } - if (InOutSelectionPolicy == EHyperTwistTrainingSelectionPolicy::Scripted + if (bReliableTrustedBroadMethodDrillRecoveryStructurePlanHandoffSource) + { + InOutSelectionPolicy = + CoachMemorySnapshot.DominantCoachSelectionPolicy != EHyperTwistTrainingSelectionPolicy::Scripted + ? CoachMemorySnapshot.DominantCoachSelectionPolicy + : EHyperTwistTrainingSelectionPolicy::Weighted; + } + else if (InOutSelectionPolicy == EHyperTwistTrainingSelectionPolicy::Scripted && CoachMemorySnapshot.DominantCoachSelectionPolicy != EHyperTwistTrainingSelectionPolicy::Scripted) { InOutSelectionPolicy = CoachMemorySnapshot.DominantCoachSelectionPolicy; diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistTraining/HyperTwistCoachDashboardWidget.h b/UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistTraining/HyperTwistCoachDashboardWidget.h index fbb131d..20ff325 100644 --- a/UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistTraining/HyperTwistCoachDashboardWidget.h +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistTraining/HyperTwistCoachDashboardWidget.h @@ -401,6 +401,8 @@ struct FHyperTwistCoachDashboardMethodDrillRecoveryMemoryHistoryEntry bool bGeneratedPacketUsedGenericMethodDrillRecoveryMemory = false; bool bGeneratedPlanUsedTightStructureContinuationPosture = false; bool bGeneratedPlanUsedBroadStructureRedirectPosture = false; + bool bGeneratedPlanUsedReliableTrustedTightStructureContinuationPosture = false; + bool bGeneratedPlanUsedReliableTrustedBroadStructureRedirectPosture = false; bool bUsedMethodDrillRecoveryMemoryForRecovery = false; bool bUsedMethodDrillRecoveryMemoryForHandoff = false;