Explain drill packet structure in recovery coaching

This commit is contained in:
axiomlogicnexus 2026-04-29 17:01:27 +02:00
parent cbb0c2e777
commit 21171dec69
2 changed files with 155 additions and 44 deletions

View file

@ -78,7 +78,9 @@ namespace HyperTwistTrainingCoachLibraryInternal
|| SourceLabel == TEXT("coach-memory-method-drill-recovery-posture-strong")
|| SourceLabel == TEXT("coach-memory-method-drill-recovery-posture-weak")
|| SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-strong")
|| SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-weak");
|| SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-weak")
|| SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-narrow")
|| SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-broad");
}
bool IsMethodDrillRecoveryPacketSource(const FString& SourceLabel)
@ -91,6 +93,16 @@ namespace HyperTwistTrainingCoachLibraryInternal
return SourceLabel.Contains(TEXT("method-drill-follow-up-packet-"));
}
bool IsNarrowMethodDrillFollowUpPacketStructureSource(const FString& SourceLabel)
{
return SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-narrow");
}
bool IsBroadMethodDrillFollowUpPacketStructureSource(const FString& SourceLabel)
{
return SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-broad");
}
bool IsStrongMethodDrillFollowUpPacketMemorySource(const FString& SourceLabel)
{
return SourceLabel.StartsWith(TEXT("coach-memory-dashboard-method-drill-follow-up-packet-strong-"))
@ -98,7 +110,7 @@ namespace HyperTwistTrainingCoachLibraryInternal
|| SourceLabel == TEXT("dashboard-handoff-method-drill-follow-up-packet-strong-follow-up")
|| SourceLabel == TEXT("dashboard-handoff-method-drill-follow-up-packet-strong-recommended")
|| SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-strong")
|| SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-narrow");
|| IsNarrowMethodDrillFollowUpPacketStructureSource(SourceLabel);
}
bool IsWeakMethodDrillFollowUpPacketMemorySource(const FString& SourceLabel)
@ -108,7 +120,7 @@ namespace HyperTwistTrainingCoachLibraryInternal
|| SourceLabel == TEXT("dashboard-handoff-method-drill-follow-up-packet-weak-follow-up")
|| SourceLabel == TEXT("dashboard-handoff-method-drill-follow-up-packet-weak-recommended")
|| SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-weak")
|| SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-broad");
|| IsBroadMethodDrillFollowUpPacketStructureSource(SourceLabel);
}
bool IsStrongMethodDrillRecoveryMemorySource(const FString& SourceLabel)
@ -128,7 +140,8 @@ namespace HyperTwistTrainingCoachLibraryInternal
|| SourceLabel == TEXT("coach-memory-method-drill-recovery-strong")
|| SourceLabel == TEXT("coach-memory-method-drill-recovery-packet-strong")
|| SourceLabel == TEXT("coach-memory-method-drill-recovery-posture-strong")
|| SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-strong");
|| SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-strong")
|| IsNarrowMethodDrillFollowUpPacketStructureSource(SourceLabel);
}
bool IsWeakMethodDrillRecoveryMemorySource(const FString& SourceLabel)
@ -148,7 +161,8 @@ namespace HyperTwistTrainingCoachLibraryInternal
|| SourceLabel == TEXT("coach-memory-method-drill-recovery-weak")
|| SourceLabel == TEXT("coach-memory-method-drill-recovery-packet-weak")
|| SourceLabel == TEXT("coach-memory-method-drill-recovery-posture-weak")
|| SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-weak");
|| SourceLabel == TEXT("coach-memory-method-drill-recovery-memory-weak")
|| IsBroadMethodDrillFollowUpPacketStructureSource(SourceLabel);
}
FString DescribeRetainedMethodDrillRecoveryStanceLabel(const FString& SourceLabel)
@ -1551,6 +1565,14 @@ TArray<FHyperTwistCoachSignal> UHyperTwistTrainingCoachLibrary::DeriveCoachSigna
HyperTwistTrainingCoachLibraryInternal::IsMethodDrillDashboardHandoffSource(
CoachMemorySnapshot.PreferredCoachHandoffSourceLabel
);
const bool bNarrowMethodDrillPacketStructureHandoff =
HyperTwistTrainingCoachLibraryInternal::IsNarrowMethodDrillFollowUpPacketStructureSource(
CoachMemorySnapshot.PreferredCoachHandoffSourceLabel
);
const bool bBroadMethodDrillPacketStructureHandoff =
HyperTwistTrainingCoachLibraryInternal::IsBroadMethodDrillFollowUpPacketStructureSource(
CoachMemorySnapshot.PreferredCoachHandoffSourceLabel
);
const bool bStrongMethodDrillDashboardHandoff =
HyperTwistTrainingCoachLibraryInternal::IsStrongMethodDrillRecoveryMemorySource(
CoachMemorySnapshot.PreferredCoachHandoffSourceLabel
@ -1588,6 +1610,14 @@ TArray<FHyperTwistCoachSignal> UHyperTwistTrainingCoachLibrary::DeriveCoachSigna
HyperTwistTrainingCoachLibraryInternal::IsWeakMethodDrillRecoveryMemorySource(
CoachMemorySnapshot.PreferredQueueRecoveryActionSourceLabel
);
const bool bNarrowMethodDrillPacketStructureRecoveryActionSource =
HyperTwistTrainingCoachLibraryInternal::IsNarrowMethodDrillFollowUpPacketStructureSource(
CoachMemorySnapshot.PreferredQueueRecoveryActionSourceLabel
);
const bool bBroadMethodDrillPacketStructureRecoveryActionSource =
HyperTwistTrainingCoachLibraryInternal::IsBroadMethodDrillFollowUpPacketStructureSource(
CoachMemorySnapshot.PreferredQueueRecoveryActionSourceLabel
);
const float Score = 66.0f
+ FMath::Min(CoachMemorySnapshot.ScheduleExecutionPressureScore * 0.25f, 20.0f)
+ (bArchiveAware ? 5.0f : 0.0f)
@ -1604,7 +1634,11 @@ TArray<FHyperTwistCoachSignal> UHyperTwistTrainingCoachLibrary::DeriveCoachSigna
FString Headline;
if (bDashboardQueuedHandoff)
{
Headline = bStrongMethodDrillDashboardHandoff
Headline = bNarrowMethodDrillPacketStructureHandoff
? (bPromoteQueueRecovery
? TEXT("Accepted narrow retained drill-follow-up-packet structure keeps the queue-first continuation slice active")
: TEXT("Accepted narrow retained drill-follow-up-packet structure favors a queue-first continuation launch"))
: (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"))
@ -1618,11 +1652,15 @@ TArray<FHyperTwistCoachSignal> 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 = bStrongMethodDrillDashboardHandoff
Headline = bNarrowMethodDrillPacketStructureHandoff
? (bPromoteQueueRecovery
? TEXT("Accepted narrow retained drill-follow-up-packet structure keeps the continuation lane active")
: TEXT("Accepted narrow retained drill-follow-up-packet structure favors recovering the continuation lane next"))
: (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"))
@ -1636,11 +1674,15 @@ TArray<FHyperTwistCoachSignal> 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 = bWeakMethodDrillDashboardHandoff
Headline = bBroadMethodDrillPacketStructureHandoff
? (bPromoteQueueRecovery
? TEXT("Accepted broad retained drill-follow-up-packet structure keeps broader redirect work active")
: TEXT("Accepted broad retained drill-follow-up-packet structure favors a broader redirect next"))
: (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"))
@ -1654,11 +1696,15 @@ TArray<FHyperTwistCoachSignal> 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 = bStrongMethodDrillRecoveryActionSource
Headline = bNarrowMethodDrillPacketStructureRecoveryActionSource
? (bPromoteQueueRecovery
? TEXT("Promote the narrow retained drill-follow-up-packet structure back into active queue flow")
: TEXT("Recover the narrow retained drill-follow-up-packet structure before the queue drifts further"))
: (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"))
@ -1668,11 +1714,15 @@ TArray<FHyperTwistCoachSignal> UHyperTwistTrainingCoachLibrary::DeriveCoachSigna
: 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 = bWeakMethodDrillRecoveryActionSource
Headline = bBroadMethodDrillPacketStructureRecoveryActionSource
? (bPromoteQueueRecovery
? TEXT("Promote the broad retained drill-follow-up-packet redirect back into the active queue")
: TEXT("Recover the broad retained drill-follow-up-packet redirect and restore queue cadence"))
: (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"))
@ -1682,7 +1732,7 @@ TArray<FHyperTwistCoachSignal> UHyperTwistTrainingCoachLibrary::DeriveCoachSigna
: 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)
{

View file

@ -157,6 +157,39 @@ namespace HyperTwistTrainingRepositoryLibraryInternal
|| SourceLabel == TEXT("dashboard-handoff-method-drill-follow-up-packet-weak-recommended");
}
bool IsNarrowMethodDrillFollowUpPacketStructureCoachMemorySource(const FString& SourceLabel)
{
return SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-narrow");
}
bool IsBroadMethodDrillFollowUpPacketStructureCoachMemorySource(const FString& SourceLabel)
{
return SourceLabel == TEXT("coach-memory-method-drill-follow-up-packet-structure-broad");
}
FString ResolveMethodDrillFollowUpPacketStructureRecoverySourceLabel(
const FString& PreferredCoachHandoffSourceLabel,
const FString& PreferredGuidanceSourceLabel)
{
if (IsNarrowMethodDrillFollowUpPacketStructureCoachMemorySource(
PreferredCoachHandoffSourceLabel)
|| IsBroadMethodDrillFollowUpPacketStructureCoachMemorySource(
PreferredCoachHandoffSourceLabel))
{
return PreferredCoachHandoffSourceLabel;
}
if (IsNarrowMethodDrillFollowUpPacketStructureCoachMemorySource(
PreferredGuidanceSourceLabel)
|| IsBroadMethodDrillFollowUpPacketStructureCoachMemorySource(
PreferredGuidanceSourceLabel))
{
return PreferredGuidanceSourceLabel;
}
return FString();
}
bool IsStrongRetainedMethodDrillRecoveryPostureDashboardHandoffSource(
const FString& SourceLabel)
{
@ -1034,20 +1067,31 @@ namespace HyperTwistTrainingRepositoryLibraryInternal
+ (static_cast<float>(RetainedMethodDrillRecoveryPostureLaunchBias) * 2.25f);
if (PromoteRecoveryActionPressure > 0.0f || LaunchRecoveryActionPressure > 0.0f)
{
const FString PacketStructureRecoverySourceLabel =
HyperTwistTrainingRepositoryLibraryInternal::
ResolveMethodDrillFollowUpPacketStructureRecoverySourceLabel(
Snapshot.PreferredCoachHandoffSourceLabel,
Snapshot.PreferredGuidanceSourceLabel
);
if (PromoteRecoveryActionPressure > LaunchRecoveryActionPressure)
{
Snapshot.PreferredQueueRecoveryAction =
EHyperTwistTrainingQueueRecoveryAction::PromoteDeferred;
Snapshot.PreferredQueueRecoveryActionSourceLabel = TEXT("queue-history-promote-pressure");
Snapshot.PreferredQueueRecoveryActionSourceLabel =
!PacketStructureRecoverySourceLabel.IsEmpty()
? PacketStructureRecoverySourceLabel
: TEXT("queue-history-promote-pressure");
}
else if (LaunchRecoveryActionPressure > PromoteRecoveryActionPressure)
{
Snapshot.PreferredQueueRecoveryAction =
EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery;
Snapshot.PreferredQueueRecoveryActionSourceLabel =
!Snapshot.PreferredCoachHandoffSourceLabel.IsEmpty()
!PacketStructureRecoverySourceLabel.IsEmpty()
? PacketStructureRecoverySourceLabel
: (!Snapshot.PreferredCoachHandoffSourceLabel.IsEmpty()
? Snapshot.PreferredCoachHandoffSourceLabel
: TEXT("queue-history-launch-pressure");
: TEXT("queue-history-launch-pressure"));
}
else
{
@ -1056,7 +1100,10 @@ namespace HyperTwistTrainingRepositoryLibraryInternal
&& !QueueExecutionSummary.bHasCompletionGap
? EHyperTwistTrainingQueueRecoveryAction::PromoteDeferred
: EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery;
Snapshot.PreferredQueueRecoveryActionSourceLabel = TEXT("queue-history-balanced-pressure");
Snapshot.PreferredQueueRecoveryActionSourceLabel =
!PacketStructureRecoverySourceLabel.IsEmpty()
? PacketStructureRecoverySourceLabel
: TEXT("queue-history-balanced-pressure");
}
}
if (Snapshot.PreferredQueueRecoveryAction == EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery
@ -7483,33 +7530,47 @@ FHyperTwistTrainingCoachMemorySnapshot UHyperTwistTrainingRepositoryLibrary::Der
+ (static_cast<float>(MethodDrillRecoveryLaunchBias) * 1.75f)
+ (static_cast<float>(RetainedMethodDrillRecoveryLaunchBias) * 2.0f)
+ (static_cast<float>(RetainedMethodDrillRecoveryPostureLaunchBias) * 2.25f);
if (PromoteRecoveryActionPressure > 0.0f || LaunchRecoveryActionPressure > 0.0f)
if (PromoteRecoveryActionPressure > 0.0f || LaunchRecoveryActionPressure > 0.0f)
{
const FString PacketStructureRecoverySourceLabel =
HyperTwistTrainingRepositoryLibraryInternal::
ResolveMethodDrillFollowUpPacketStructureRecoverySourceLabel(
Snapshot.PreferredCoachHandoffSourceLabel,
Snapshot.PreferredGuidanceSourceLabel
);
if (PromoteRecoveryActionPressure > LaunchRecoveryActionPressure)
{
if (PromoteRecoveryActionPressure > LaunchRecoveryActionPressure)
{
Snapshot.PreferredQueueRecoveryAction =
EHyperTwistTrainingQueueRecoveryAction::PromoteDeferred;
Snapshot.PreferredQueueRecoveryActionSourceLabel = TEXT("queue-history-promote-pressure");
}
else if (LaunchRecoveryActionPressure > PromoteRecoveryActionPressure)
{
Snapshot.PreferredQueueRecoveryAction =
EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery;
Snapshot.PreferredQueueRecoveryActionSourceLabel =
!Snapshot.PreferredCoachHandoffSourceLabel.IsEmpty()
? Snapshot.PreferredCoachHandoffSourceLabel
: TEXT("queue-history-launch-pressure");
}
else
{
Snapshot.PreferredQueueRecoveryAction =
QueueExecutionSummary.bHasOutstandingDeferredWork
&& !QueueExecutionSummary.bHasCompletionGap
? EHyperTwistTrainingQueueRecoveryAction::PromoteDeferred
: EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery;
Snapshot.PreferredQueueRecoveryActionSourceLabel = TEXT("queue-history-balanced-pressure");
}
Snapshot.PreferredQueueRecoveryAction =
EHyperTwistTrainingQueueRecoveryAction::PromoteDeferred;
Snapshot.PreferredQueueRecoveryActionSourceLabel =
!PacketStructureRecoverySourceLabel.IsEmpty()
? PacketStructureRecoverySourceLabel
: TEXT("queue-history-promote-pressure");
}
else if (LaunchRecoveryActionPressure > PromoteRecoveryActionPressure)
{
Snapshot.PreferredQueueRecoveryAction =
EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery;
Snapshot.PreferredQueueRecoveryActionSourceLabel =
!PacketStructureRecoverySourceLabel.IsEmpty()
? PacketStructureRecoverySourceLabel
: (!Snapshot.PreferredCoachHandoffSourceLabel.IsEmpty()
? Snapshot.PreferredCoachHandoffSourceLabel
: TEXT("queue-history-launch-pressure"));
}
else
{
Snapshot.PreferredQueueRecoveryAction =
QueueExecutionSummary.bHasOutstandingDeferredWork
&& !QueueExecutionSummary.bHasCompletionGap
? EHyperTwistTrainingQueueRecoveryAction::PromoteDeferred
: EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery;
Snapshot.PreferredQueueRecoveryActionSourceLabel =
!PacketStructureRecoverySourceLabel.IsEmpty()
? PacketStructureRecoverySourceLabel
: TEXT("queue-history-balanced-pressure");
}
}
if (Snapshot.PreferredQueueRecoveryAction == EHyperTwistTrainingQueueRecoveryAction::LaunchRecovery
&& HyperTwistTrainingRepositoryLibraryInternal::IsStrongMethodDrillRecoveryPacketCoachMemorySource(
Snapshot.PreferredCoachHandoffSourceLabel))