Persist accepted packet trust upstream

This commit is contained in:
axiomlogicnexus 2026-04-30 01:09:05 +02:00
parent 30dea6b122
commit a809df8f09
3 changed files with 225 additions and 25 deletions

View file

@ -342,6 +342,8 @@ namespace HyperTwistCoachDashboardWidgetInternal
== TEXT("recommendation-history-accepted-aligned-tight-follow-up-packet-outcome")
|| SourceLabel == TEXT("coach-memory-aligned-follow-up-packet-structure-tight-follow-up")
|| SourceLabel.StartsWith(TEXT("coach-memory-dashboard-aligned-follow-up-packet-tight-"))
|| SourceLabel.StartsWith(
TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-tight-"))
|| SourceLabel == TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-queued")
|| SourceLabel == TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-follow-up")
|| SourceLabel == TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-recommended");
@ -353,6 +355,8 @@ namespace HyperTwistCoachDashboardWidgetInternal
== TEXT("recommendation-history-accepted-aligned-broad-recommended-packet-outcome")
|| SourceLabel == TEXT("coach-memory-aligned-follow-up-packet-structure-broad-recommended")
|| SourceLabel.StartsWith(TEXT("coach-memory-dashboard-aligned-follow-up-packet-broad-"))
|| SourceLabel.StartsWith(
TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-broad-"))
|| SourceLabel == TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-queued")
|| SourceLabel == TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-follow-up")
|| SourceLabel == TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-recommended");
@ -410,11 +414,9 @@ namespace HyperTwistCoachDashboardWidgetInternal
}
if (IsAlignedTightFollowUpGuidanceSourceLabel(SourceLabel))
{
if (SourceLabel.StartsWith(TEXT("coach-memory-dashboard-aligned-follow-up-packet-tight-")))
{
return TEXT("accepted aligned tight follow-up-packet handoff history");
}
if (SourceLabel == TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-queued")
if (SourceLabel.StartsWith(
TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-tight-"))
|| SourceLabel == TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-queued")
|| SourceLabel
== TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-follow-up")
|| SourceLabel
@ -422,6 +424,10 @@ namespace HyperTwistCoachDashboardWidgetInternal
{
return TEXT("accepted aligned tight follow-up-packet outcome trust");
}
if (SourceLabel.StartsWith(TEXT("coach-memory-dashboard-aligned-follow-up-packet-tight-")))
{
return TEXT("accepted aligned tight follow-up-packet handoff history");
}
if (SourceLabel
== TEXT("recommendation-history-accepted-aligned-tight-follow-up-packet-outcome"))
{
@ -434,11 +440,9 @@ namespace HyperTwistCoachDashboardWidgetInternal
}
if (IsAlignedBroadRecommendedGuidanceSourceLabel(SourceLabel))
{
if (SourceLabel.StartsWith(TEXT("coach-memory-dashboard-aligned-follow-up-packet-broad-")))
{
return TEXT("accepted aligned broad recommended-packet handoff history");
}
if (SourceLabel == TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-queued")
if (SourceLabel.StartsWith(
TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-broad-"))
|| SourceLabel == TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-queued")
|| SourceLabel
== TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-follow-up")
|| SourceLabel
@ -446,6 +450,10 @@ namespace HyperTwistCoachDashboardWidgetInternal
{
return TEXT("accepted aligned broad recommended-packet outcome trust");
}
if (SourceLabel.StartsWith(TEXT("coach-memory-dashboard-aligned-follow-up-packet-broad-")))
{
return TEXT("accepted aligned broad recommended-packet handoff history");
}
if (SourceLabel
== TEXT("recommendation-history-accepted-aligned-broad-recommended-packet-outcome"))
{

View file

@ -337,6 +337,8 @@ namespace HyperTwistTrainingCoachLibraryInternal
== TEXT("recommendation-history-accepted-aligned-tight-follow-up-packet-outcome")
|| SourceLabel == TEXT("coach-memory-aligned-follow-up-packet-structure-tight-follow-up")
|| SourceLabel.StartsWith(TEXT("coach-memory-dashboard-aligned-follow-up-packet-tight-"))
|| SourceLabel.StartsWith(
TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-tight-"))
|| SourceLabel == TEXT("dashboard-handoff-aligned-follow-up-packet-tight-queued")
|| SourceLabel == TEXT("dashboard-handoff-aligned-follow-up-packet-tight-follow-up")
|| SourceLabel == TEXT("dashboard-handoff-aligned-follow-up-packet-tight-recommended")
@ -356,6 +358,8 @@ namespace HyperTwistTrainingCoachLibraryInternal
|| SourceLabel
== TEXT("coach-memory-aligned-follow-up-packet-structure-broad-recommended")
|| SourceLabel.StartsWith(TEXT("coach-memory-dashboard-aligned-follow-up-packet-broad-"))
|| SourceLabel.StartsWith(
TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-broad-"))
|| SourceLabel == TEXT("dashboard-handoff-aligned-follow-up-packet-broad-queued")
|| SourceLabel == TEXT("dashboard-handoff-aligned-follow-up-packet-broad-follow-up")
|| SourceLabel == TEXT("dashboard-handoff-aligned-follow-up-packet-broad-recommended")
@ -419,7 +423,10 @@ namespace HyperTwistTrainingCoachLibraryInternal
}
if (IsAlignedTightFollowUpGuidanceSourceLabel(SourceLabel))
{
if (SourceLabel == TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-queued")
if (SourceLabel.StartsWith(
TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-tight-"))
|| SourceLabel
== TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-queued")
|| SourceLabel
== TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-tight-follow-up")
|| SourceLabel
@ -446,7 +453,10 @@ namespace HyperTwistTrainingCoachLibraryInternal
}
if (IsAlignedBroadRecommendedGuidanceSourceLabel(SourceLabel))
{
if (SourceLabel == TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-queued")
if (SourceLabel.StartsWith(
TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-broad-"))
|| SourceLabel
== TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-queued")
|| SourceLabel
== TEXT("dashboard-handoff-accepted-aligned-follow-up-packet-broad-follow-up")
|| SourceLabel

View file

@ -465,6 +465,8 @@ namespace HyperTwistTrainingRepositoryLibraryInternal
return SourceLabel
== TEXT("recommendation-history-accepted-aligned-tight-follow-up-packet-outcome")
|| SourceLabel.StartsWith(TEXT("coach-memory-dashboard-aligned-follow-up-packet-tight-"))
|| SourceLabel.StartsWith(
TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-tight-"))
|| SourceLabel == TEXT("dashboard-handoff-aligned-follow-up-packet-tight-queued")
|| SourceLabel == TEXT("dashboard-handoff-aligned-follow-up-packet-tight-follow-up")
|| SourceLabel == TEXT("dashboard-handoff-aligned-follow-up-packet-tight-recommended")
@ -481,6 +483,8 @@ namespace HyperTwistTrainingRepositoryLibraryInternal
return SourceLabel
== TEXT("recommendation-history-accepted-aligned-broad-recommended-packet-outcome")
|| SourceLabel.StartsWith(TEXT("coach-memory-dashboard-aligned-follow-up-packet-broad-"))
|| SourceLabel.StartsWith(
TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-broad-"))
|| SourceLabel == TEXT("dashboard-handoff-aligned-follow-up-packet-broad-queued")
|| SourceLabel == TEXT("dashboard-handoff-aligned-follow-up-packet-broad-follow-up")
|| SourceLabel == TEXT("dashboard-handoff-aligned-follow-up-packet-broad-recommended")
@ -814,6 +818,29 @@ namespace HyperTwistTrainingRepositoryLibraryInternal
}
}
FString AcceptedAlignedPacketOutcomeCoachMemoryDashboardSourceLabel(
const EHyperTwistTrainingCoachHandoffKind HandoffKind,
const bool bTightFollowUpOutcomeTrust)
{
switch (HandoffKind)
{
case EHyperTwistTrainingCoachHandoffKind::Queue:
return bTightFollowUpOutcomeTrust
? TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-tight-queued")
: TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-broad-queued");
case EHyperTwistTrainingCoachHandoffKind::FollowUp:
return bTightFollowUpOutcomeTrust
? TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-tight-follow-up")
: TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-broad-follow-up");
case EHyperTwistTrainingCoachHandoffKind::Recommended:
return bTightFollowUpOutcomeTrust
? TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-tight-recommended")
: TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-broad-recommended");
default:
return FString();
}
}
bool IsDeferredOverflowDashboardHandoffSource(const FString& SourceLabel)
{
return SourceLabel.StartsWith(TEXT("coach-memory-dashboard-deferred-overflow-"))
@ -8922,17 +8949,17 @@ FHyperTwistTrainingCoachMemorySnapshot UHyperTwistTrainingRepositoryLibrary::Der
0,
5
);
const int32 ExplicitQueuedHandoffSignal = FMath::Clamp(
int32 ExplicitQueuedHandoffSignal = FMath::Clamp(
QueueExecutionSummary.StartedQueuedHandoffEventCount,
0,
3
);
const int32 ExplicitFollowUpHandoffSignal = FMath::Clamp(
int32 ExplicitFollowUpHandoffSignal = FMath::Clamp(
QueueExecutionSummary.StartedFollowUpHandoffEventCount * 2,
0,
4
);
const int32 ExplicitRecommendedHandoffSignal = FMath::Clamp(
int32 ExplicitRecommendedHandoffSignal = FMath::Clamp(
QueueExecutionSummary.StartedRecommendedHandoffEventCount * 2,
0,
4
@ -9492,6 +9519,103 @@ FHyperTwistTrainingCoachMemorySnapshot UHyperTwistTrainingRepositoryLibrary::Der
QueueExecutionSummary.StartedAlignedBroadRecommendedPacketQueuedHandoffEventCount
+ QueueExecutionSummary.StartedAlignedBroadRecommendedPacketFollowUpHandoffEventCount
+ QueueExecutionSummary.StartedAlignedBroadRecommendedPacketRecommendedHandoffEventCount;
const int32 AcceptedAlignedTightPacketOutcomeTrustSignal =
(Snapshot.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount >= 2
&& Snapshot.AcceptedAlignedTightFollowUpPacketOutcomeAverageScore >= 60.0f)
? FMath::Clamp(
Snapshot.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount
- Snapshot.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount
+ (Snapshot.AcceptedAlignedTightFollowUpPacketOutcomeAverageScore
>= 80.0f
? 1
: 0),
1,
4)
: 0;
const int32 AcceptedAlignedBroadPacketOutcomeTrustSignal =
(Snapshot.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount >= 2
&& Snapshot.AcceptedAlignedBroadRecommendedPacketOutcomeAverageScore >= 58.0f)
? FMath::Clamp(
Snapshot.AcceptedAlignedBroadRecommendedPacketOutcomeHistoryCount
- Snapshot.AcceptedAlignedTightFollowUpPacketOutcomeHistoryCount
+ (Snapshot.AcceptedAlignedBroadRecommendedPacketOutcomeAverageScore
>= 78.0f
? 1
: 0),
1,
4)
: 0;
if (AcceptedAlignedTightPacketOutcomeTrustSignal
> AcceptedAlignedBroadPacketOutcomeTrustSignal)
{
Snapshot.FollowUpGuidanceContinueBias +=
AcceptedAlignedTightPacketOutcomeTrustSignal;
Snapshot.SuppressedPrimaryQueuePressureCount +=
FMath::Max(1, AcceptedAlignedTightPacketOutcomeTrustSignal - 1);
ExplicitFollowUpHandoffSignal = FMath::Clamp(
ExplicitFollowUpHandoffSignal
+ (AcceptedAlignedTightPacketOutcomeTrustSignal * 2),
0,
6);
if (QueueExecutionSummary.bHasOutstandingDeferredWork
|| QueueExecutionSummary.StartedQueuedHandoffEventCount > 0)
{
ExplicitQueuedHandoffSignal = FMath::Clamp(
ExplicitQueuedHandoffSignal
+ FMath::Min(2, AcceptedAlignedTightPacketOutcomeTrustSignal),
0,
5);
}
if (Snapshot.PreferredGuidanceLane == EHyperTwistTrainingCoachGuidanceLane::None
|| Snapshot.PreferredGuidanceLane
== EHyperTwistTrainingCoachGuidanceLane::Recommended
|| Snapshot.PreferredGuidanceSourceLabel.StartsWith(TEXT("recommendation-history"))
|| HyperTwistTrainingRepositoryLibraryInternal::IsAlignedTightFollowUpPacketStructureCoachMemorySource(
Snapshot.PreferredGuidanceSourceLabel)
|| HyperTwistTrainingRepositoryLibraryInternal::IsAcceptedAlignedTightFollowUpPacketOutcomeSource(
Snapshot.PreferredGuidanceSourceLabel)
|| HyperTwistTrainingRepositoryLibraryInternal::IsAlignedBroadRecommendedPacketStructureCoachMemorySource(
Snapshot.PreferredGuidanceSourceLabel)
|| HyperTwistTrainingRepositoryLibraryInternal::IsAcceptedAlignedBroadRecommendedPacketOutcomeSource(
Snapshot.PreferredGuidanceSourceLabel))
{
Snapshot.PreferredGuidanceLane =
EHyperTwistTrainingCoachGuidanceLane::FollowUp;
Snapshot.PreferredGuidanceSourceLabel =
TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-tight-follow-up");
}
}
else if (AcceptedAlignedBroadPacketOutcomeTrustSignal
> AcceptedAlignedTightPacketOutcomeTrustSignal)
{
Snapshot.RecommendedGuidanceContinueBias +=
AcceptedAlignedBroadPacketOutcomeTrustSignal;
Snapshot.SuppressedFollowUpQueuePressureCount +=
AcceptedAlignedBroadPacketOutcomeTrustSignal;
ExplicitRecommendedHandoffSignal = FMath::Clamp(
ExplicitRecommendedHandoffSignal
+ (AcceptedAlignedBroadPacketOutcomeTrustSignal * 2),
0,
6);
if (Snapshot.PreferredGuidanceLane == EHyperTwistTrainingCoachGuidanceLane::None
|| Snapshot.PreferredGuidanceLane
== EHyperTwistTrainingCoachGuidanceLane::FollowUp
|| Snapshot.PreferredGuidanceSourceLabel.StartsWith(TEXT("recommendation-history"))
|| HyperTwistTrainingRepositoryLibraryInternal::IsAlignedTightFollowUpPacketStructureCoachMemorySource(
Snapshot.PreferredGuidanceSourceLabel)
|| HyperTwistTrainingRepositoryLibraryInternal::IsAcceptedAlignedTightFollowUpPacketOutcomeSource(
Snapshot.PreferredGuidanceSourceLabel)
|| HyperTwistTrainingRepositoryLibraryInternal::IsAlignedBroadRecommendedPacketStructureCoachMemorySource(
Snapshot.PreferredGuidanceSourceLabel)
|| HyperTwistTrainingRepositoryLibraryInternal::IsAcceptedAlignedBroadRecommendedPacketOutcomeSource(
Snapshot.PreferredGuidanceSourceLabel))
{
Snapshot.PreferredGuidanceLane =
EHyperTwistTrainingCoachGuidanceLane::Recommended;
Snapshot.PreferredGuidanceSourceLabel =
TEXT("coach-memory-dashboard-accepted-aligned-follow-up-packet-broad-recommended");
}
}
if (StrongMethodDrillFollowUpPacketStartedCount > 0
&& StrongMethodDrillFollowUpPacketStartedCount
>= WeakMethodDrillFollowUpPacketStartedCount)
@ -9665,6 +9789,22 @@ FHyperTwistTrainingCoachMemorySnapshot UHyperTwistTrainingRepositoryLibrary::Der
Snapshot.PreferredCoachHandoffSourceLabel =
TEXT("coach-memory-dashboard-method-drill-follow-up-packet-strong-queued");
}
else if (AcceptedAlignedTightPacketOutcomeTrustSignal
> AcceptedAlignedBroadPacketOutcomeTrustSignal)
{
Snapshot.PreferredCoachHandoffSourceLabel =
HyperTwistTrainingRepositoryLibraryInternal::AcceptedAlignedPacketOutcomeCoachMemoryDashboardSourceLabel(
EHyperTwistTrainingCoachHandoffKind::Queue,
true);
}
else if (AcceptedAlignedBroadPacketOutcomeTrustSignal
> AcceptedAlignedTightPacketOutcomeTrustSignal)
{
Snapshot.PreferredCoachHandoffSourceLabel =
HyperTwistTrainingRepositoryLibraryInternal::AcceptedAlignedPacketOutcomeCoachMemoryDashboardSourceLabel(
EHyperTwistTrainingCoachHandoffKind::Queue,
false);
}
else if (bAlignedTightFollowUpPacketQueuedHandoff)
{
Snapshot.PreferredCoachHandoffSourceLabel =
@ -9736,6 +9876,22 @@ FHyperTwistTrainingCoachMemorySnapshot UHyperTwistTrainingRepositoryLibrary::Der
Snapshot.PreferredCoachHandoffSourceLabel =
TEXT("coach-memory-dashboard-method-drill-follow-up-packet-strong-follow-up");
}
else if (AcceptedAlignedTightPacketOutcomeTrustSignal
> AcceptedAlignedBroadPacketOutcomeTrustSignal)
{
Snapshot.PreferredCoachHandoffSourceLabel =
HyperTwistTrainingRepositoryLibraryInternal::AcceptedAlignedPacketOutcomeCoachMemoryDashboardSourceLabel(
EHyperTwistTrainingCoachHandoffKind::FollowUp,
true);
}
else if (AcceptedAlignedBroadPacketOutcomeTrustSignal
> AcceptedAlignedTightPacketOutcomeTrustSignal)
{
Snapshot.PreferredCoachHandoffSourceLabel =
HyperTwistTrainingRepositoryLibraryInternal::AcceptedAlignedPacketOutcomeCoachMemoryDashboardSourceLabel(
EHyperTwistTrainingCoachHandoffKind::FollowUp,
false);
}
else if (bAlignedTightFollowUpPacketFollowUpHandoff)
{
Snapshot.PreferredCoachHandoffSourceLabel =
@ -9807,6 +9963,22 @@ FHyperTwistTrainingCoachMemorySnapshot UHyperTwistTrainingRepositoryLibrary::Der
Snapshot.PreferredCoachHandoffSourceLabel =
TEXT("coach-memory-dashboard-method-drill-follow-up-packet-strong-recommended");
}
else if (AcceptedAlignedTightPacketOutcomeTrustSignal
> AcceptedAlignedBroadPacketOutcomeTrustSignal)
{
Snapshot.PreferredCoachHandoffSourceLabel =
HyperTwistTrainingRepositoryLibraryInternal::AcceptedAlignedPacketOutcomeCoachMemoryDashboardSourceLabel(
EHyperTwistTrainingCoachHandoffKind::Recommended,
true);
}
else if (AcceptedAlignedBroadPacketOutcomeTrustSignal
> AcceptedAlignedTightPacketOutcomeTrustSignal)
{
Snapshot.PreferredCoachHandoffSourceLabel =
HyperTwistTrainingRepositoryLibraryInternal::AcceptedAlignedPacketOutcomeCoachMemoryDashboardSourceLabel(
EHyperTwistTrainingCoachHandoffKind::Recommended,
false);
}
else if (bAlignedTightFollowUpPacketRecommendedHandoff)
{
Snapshot.PreferredCoachHandoffSourceLabel =
@ -10313,12 +10485,17 @@ FHyperTwistTrainingCoachMemorySnapshot UHyperTwistTrainingRepositoryLibrary::Der
{
Snapshot.PreferredGuidanceLane = EHyperTwistTrainingCoachGuidanceLane::FollowUp;
Snapshot.PreferredGuidanceSourceLabel = ExplicitFollowUpHandoffSignal > 0
? HyperTwistTrainingRepositoryLibraryInternal::CoachMemoryDashboardSourceLabel(
EHyperTwistTrainingCoachHandoffKind::FollowUp,
ExplicitDeferredOverflowFollowUpHandoffSignal > 0,
ExplicitDeferredFirstFollowUpHandoffSignal > 0
|| ExplicitDeferredFirstQueuedHandoffSignal > 0
)
? (AcceptedAlignedTightPacketOutcomeTrustSignal
> AcceptedAlignedBroadPacketOutcomeTrustSignal
? HyperTwistTrainingRepositoryLibraryInternal::AcceptedAlignedPacketOutcomeCoachMemoryDashboardSourceLabel(
EHyperTwistTrainingCoachHandoffKind::FollowUp,
true)
: HyperTwistTrainingRepositoryLibraryInternal::CoachMemoryDashboardSourceLabel(
EHyperTwistTrainingCoachHandoffKind::FollowUp,
ExplicitDeferredOverflowFollowUpHandoffSignal > 0,
ExplicitDeferredFirstFollowUpHandoffSignal > 0
|| ExplicitDeferredFirstQueuedHandoffSignal > 0
))
: TEXT("coach-memory-queue-follow-up");
}
else if (bQueueHistoryPrefersRecommended
@ -10328,10 +10505,15 @@ FHyperTwistTrainingCoachMemorySnapshot UHyperTwistTrainingRepositoryLibrary::Der
{
Snapshot.PreferredGuidanceLane = EHyperTwistTrainingCoachGuidanceLane::Recommended;
Snapshot.PreferredGuidanceSourceLabel = ExplicitRecommendedHandoffSignal > 0
? HyperTwistTrainingRepositoryLibraryInternal::CoachMemoryDashboardSourceLabel(
EHyperTwistTrainingCoachHandoffKind::Recommended,
ExplicitDeferredOverflowRecommendedHandoffSignal > 0
)
? (AcceptedAlignedBroadPacketOutcomeTrustSignal
> AcceptedAlignedTightPacketOutcomeTrustSignal
? HyperTwistTrainingRepositoryLibraryInternal::AcceptedAlignedPacketOutcomeCoachMemoryDashboardSourceLabel(
EHyperTwistTrainingCoachHandoffKind::Recommended,
false)
: HyperTwistTrainingRepositoryLibraryInternal::CoachMemoryDashboardSourceLabel(
EHyperTwistTrainingCoachHandoffKind::Recommended,
ExplicitDeferredOverflowRecommendedHandoffSignal > 0
))
: TEXT("coach-memory-queue-recommended");
}
}