Retain aligned packet handoff history on dashboard

This commit is contained in:
axiomlogicnexus 2026-04-30 00:01:29 +02:00
parent 640a29f3a8
commit ed3184f628
2 changed files with 105 additions and 10 deletions

View file

@ -42,6 +42,8 @@ namespace HyperTwistCoachDashboardWidgetInternal
int32 RecommendedAcceptedDeltaCount = 0;
int32 AlignedTightFollowUpOutcomeAcceptedDeltaCount = 0;
int32 AlignedBroadRecommendedOutcomeAcceptedDeltaCount = 0;
int32 AlignedTightFollowUpPacketAcceptedDeltaCount = 0;
int32 AlignedBroadRecommendedPacketAcceptedDeltaCount = 0;
int32 DeferredOverflowQueueAcceptedDeltaCount = 0;
int32 DeferredOverflowFollowUpAcceptedDeltaCount = 0;
int32 DeferredOverflowRecommendedAcceptedDeltaCount = 0;
@ -111,6 +113,7 @@ namespace HyperTwistCoachDashboardWidgetInternal
bool bHasReliableAlignedTrustedTightPlanOutcomeSignal = false;
bool bHasReliableAlignedTrustedBroadPlanOutcomeSignal = false;
bool bHasAlignedGuidanceOutcomeAcceptedSignal = false;
bool bHasAlignedPacketAcceptedSignal = false;
bool bHasSignal = false;
};
@ -323,17 +326,37 @@ namespace HyperTwistCoachDashboardWidgetInternal
|| 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("coach-memory-aligned-follow-up-packet-structure-tight-follow-up");
}
bool IsAlignedBroadRecommendedPacketSourceLabel(const FString& SourceLabel)
{
return SourceLabel
== TEXT("coach-memory-aligned-follow-up-packet-structure-broad-recommended");
}
bool IsAlignedTightFollowUpGuidanceSourceLabel(const FString& SourceLabel)
{
return SourceLabel == TEXT("recommendation-history-aligned-tight-follow-up-outcome")
|| SourceLabel == TEXT("coach-memory-aligned-follow-up-packet-structure-tight-follow-up");
return IsAlignedTightFollowUpOutcomeSourceLabel(SourceLabel)
|| IsAlignedTightFollowUpPacketSourceLabel(SourceLabel);
}
bool IsAlignedBroadRecommendedGuidanceSourceLabel(const FString& SourceLabel)
{
return SourceLabel == TEXT("recommendation-history-aligned-broad-recommended-outcome")
|| SourceLabel
== TEXT("coach-memory-aligned-follow-up-packet-structure-broad-recommended");
return IsAlignedBroadRecommendedOutcomeSourceLabel(SourceLabel)
|| IsAlignedBroadRecommendedPacketSourceLabel(SourceLabel);
}
FString DescribeCoachMemorySourceLabel(const FString& SourceLabel)
@ -1419,6 +1442,10 @@ namespace HyperTwistCoachDashboardWidgetInternal
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 QueuedDelta =
FMath::Max(0, Entry.AcceptedQueuedHandoffCount - PreviousQueuedCount);
@ -1461,6 +1488,16 @@ namespace HyperTwistCoachDashboardWidgetInternal
Entry.AcceptedAlignedBroadRecommendedOutcomeHandoffCount
- PreviousAlignedBroadRecommendedOutcomeCount
);
const int32 AlignedTightFollowUpPacketDelta = FMath::Max(
0,
Entry.AcceptedAlignedTightFollowUpPacketHandoffCount
- PreviousAlignedTightFollowUpPacketCount
);
const int32 AlignedBroadRecommendedPacketDelta = FMath::Max(
0,
Entry.AcceptedAlignedBroadRecommendedPacketHandoffCount
- PreviousAlignedBroadRecommendedPacketCount
);
if (QueuedDelta > 0)
{
@ -1504,6 +1541,13 @@ namespace HyperTwistCoachDashboardWidgetInternal
Bias.FollowUpScore += AlignedTightFollowUpOutcomeDelta * 4;
Bias.bHasAlignedGuidanceOutcomeAcceptedSignal = true;
}
if (AlignedTightFollowUpPacketDelta > 0)
{
Bias.AlignedTightFollowUpPacketAcceptedDeltaCount +=
AlignedTightFollowUpPacketDelta;
Bias.FollowUpScore += AlignedTightFollowUpPacketDelta * 4;
Bias.bHasAlignedPacketAcceptedSignal = true;
}
if (Entry.bUsedReliableTrustedTightStructurePlanHistory)
{
Bias.ReliableTrustedTightFollowUpAcceptedDeltaCount += FollowUpDelta;
@ -1541,6 +1585,13 @@ namespace HyperTwistCoachDashboardWidgetInternal
Bias.RecommendedScore += AlignedBroadRecommendedOutcomeDelta * 4;
Bias.bHasAlignedGuidanceOutcomeAcceptedSignal = true;
}
if (AlignedBroadRecommendedPacketDelta > 0)
{
Bias.AlignedBroadRecommendedPacketAcceptedDeltaCount +=
AlignedBroadRecommendedPacketDelta;
Bias.RecommendedScore += AlignedBroadRecommendedPacketDelta * 4;
Bias.bHasAlignedPacketAcceptedSignal = true;
}
if (Entry.bUsedReliableTrustedTightStructurePlanHistory)
{
Bias.ReliableTrustedTightRecommendedAcceptedDeltaCount += RecommendedDelta;
@ -8115,6 +8166,14 @@ void UHyperTwistCoachDashboardWidget::RecordCoachHandoffHistorySnapshot(
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 AcceptedFollowUpHandoffDelta = FMath::Max(
0,
Entry.AcceptedFollowUpHandoffCount - PreviousAcceptedFollowUpHandoffCount
@ -8124,10 +8183,16 @@ void UHyperTwistCoachDashboardWidget::RecordCoachHandoffHistorySnapshot(
Entry.AcceptedRecommendedHandoffCount - PreviousAcceptedRecommendedHandoffCount
);
const bool bAlignedTightFollowUpGuidanceOutcomeSource =
HyperTwistCoachDashboardWidgetInternal::IsAlignedTightFollowUpGuidanceSourceLabel(
HyperTwistCoachDashboardWidgetInternal::IsAlignedTightFollowUpOutcomeSourceLabel(
CachedCoachPanelState.PreferredGuidanceSourceLabel);
const bool bAlignedBroadRecommendedGuidanceOutcomeSource =
HyperTwistCoachDashboardWidgetInternal::IsAlignedBroadRecommendedGuidanceSourceLabel(
HyperTwistCoachDashboardWidgetInternal::IsAlignedBroadRecommendedOutcomeSourceLabel(
CachedCoachPanelState.PreferredGuidanceSourceLabel);
const bool bAlignedTightFollowUpPacketSource =
HyperTwistCoachDashboardWidgetInternal::IsAlignedTightFollowUpPacketSourceLabel(
CachedCoachPanelState.PreferredGuidanceSourceLabel);
const bool bAlignedBroadRecommendedPacketSource =
HyperTwistCoachDashboardWidgetInternal::IsAlignedBroadRecommendedPacketSourceLabel(
CachedCoachPanelState.PreferredGuidanceSourceLabel);
Entry.AcceptedAlignedTightFollowUpOutcomeHandoffCount =
PreviousAcceptedAlignedTightFollowUpOutcomeHandoffCount
@ -8135,6 +8200,12 @@ void UHyperTwistCoachDashboardWidget::RecordCoachHandoffHistorySnapshot(
Entry.AcceptedAlignedBroadRecommendedOutcomeHandoffCount =
PreviousAcceptedAlignedBroadRecommendedOutcomeHandoffCount
+ (bAlignedBroadRecommendedGuidanceOutcomeSource ? AcceptedRecommendedHandoffDelta : 0);
Entry.AcceptedAlignedTightFollowUpPacketHandoffCount =
PreviousAcceptedAlignedTightFollowUpPacketHandoffCount
+ (bAlignedTightFollowUpPacketSource ? AcceptedFollowUpHandoffDelta : 0);
Entry.AcceptedAlignedBroadRecommendedPacketHandoffCount =
PreviousAcceptedAlignedBroadRecommendedPacketHandoffCount
+ (bAlignedBroadRecommendedPacketSource ? AcceptedRecommendedHandoffDelta : 0);
Entry.ReliableAlignedTrustedTightPlanOutcomeHistoryCount =
CachedCoachPanelState
.ReliableAlignedTrustedTightMethodDrillRecoveryStructurePlanOutcomeHistoryCount;
@ -8212,6 +8283,10 @@ void UHyperTwistCoachDashboardWidget::RecordCoachHandoffHistorySnapshot(
== Entry.AcceptedAlignedTightFollowUpOutcomeHandoffCount
&& HandoffHistoryEntries.Last().AcceptedAlignedBroadRecommendedOutcomeHandoffCount
== Entry.AcceptedAlignedBroadRecommendedOutcomeHandoffCount
&& HandoffHistoryEntries.Last().AcceptedAlignedTightFollowUpPacketHandoffCount
== Entry.AcceptedAlignedTightFollowUpPacketHandoffCount
&& HandoffHistoryEntries.Last().AcceptedAlignedBroadRecommendedPacketHandoffCount
== Entry.AcceptedAlignedBroadRecommendedPacketHandoffCount
&& HandoffHistoryEntries.Last().ReliableAlignedTrustedTightPlanOutcomeHistoryCount
== Entry.ReliableAlignedTrustedTightPlanOutcomeHistoryCount
&& HandoffHistoryEntries.Last().ReliableAlignedTrustedBroadPlanOutcomeHistoryCount
@ -10564,9 +10639,11 @@ void UHyperTwistCoachDashboardWidget::UpdateDashboardPresentation()
HandoffHistoryBias.RecommendedRecommendationCount
);
CoachHandoffRecommendationDetailLine += FString::Printf(
TEXT(" | aligned guidance accepted follow-up/recommended %d/%d"),
TEXT(" | aligned guidance accepted follow-up/recommended %d/%d | aligned packet accepted follow-up/recommended %d/%d"),
HandoffHistoryBias.AlignedTightFollowUpOutcomeAcceptedDeltaCount,
HandoffHistoryBias.AlignedBroadRecommendedOutcomeAcceptedDeltaCount
HandoffHistoryBias.AlignedBroadRecommendedOutcomeAcceptedDeltaCount,
HandoffHistoryBias.AlignedTightFollowUpPacketAcceptedDeltaCount,
HandoffHistoryBias.AlignedBroadRecommendedPacketAcceptedDeltaCount
);
if (HandoffHistoryBias.AlignedTightFollowUpOutcomeAcceptedDeltaCount > 0
&& HandoffHistoryBias.PreferredKind
@ -10582,6 +10659,20 @@ void UHyperTwistCoachDashboardWidget::UpdateDashboardPresentation()
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.");
}
CoachHandoffRecommendationDetailLine += FString::Printf(
TEXT(" | upstream drill recovery strong/weak/history %d/%d/%d avg %.1f"),
CachedCoachPanelState.StrongMethodDrillRecoveryHistoryCount,
@ -10902,12 +10993,14 @@ void UHyperTwistCoachDashboardWidget::UpdateDashboardPresentation()
const FString HandoffHistoryDetailLine =
SelectedHandoffHistoryEntry != nullptr
? FString::Printf(
TEXT("Accepted queued/follow-up/recommended: %d/%d/%d | aligned guidance accepted 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"),
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 | 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->AcceptedDeferredOverflowQueuedHandoffCount,
SelectedHandoffHistoryEntry->AcceptedDeferredOverflowFollowUpHandoffCount,
SelectedHandoffHistoryEntry->AcceptedDeferredOverflowRecommendedHandoffCount,

View file

@ -340,6 +340,8 @@ struct FHyperTwistCoachDashboardHandoffHistoryEntry
int32 AcceptedMethodDrillRecommendedHandoffCount = 0;
int32 AcceptedAlignedTightFollowUpOutcomeHandoffCount = 0;
int32 AcceptedAlignedBroadRecommendedOutcomeHandoffCount = 0;
int32 AcceptedAlignedTightFollowUpPacketHandoffCount = 0;
int32 AcceptedAlignedBroadRecommendedPacketHandoffCount = 0;
int32 ReliableAlignedTrustedTightPlanOutcomeHistoryCount = 0;
int32 ReliableAlignedTrustedBroadPlanOutcomeHistoryCount = 0;
float ReliableAlignedTrustedTightPlanOutcomeAverageScore = 0.0f;