Implement Phase 6R-M6 derived memory and optional adjunct
This commit is contained in:
parent
b5c5cd7c94
commit
740b89e6bd
14 changed files with 1563 additions and 12 deletions
|
|
@ -3868,6 +3868,47 @@ FHyperTwistMemoryKnowledgeNotesState
|
|||
);
|
||||
}
|
||||
|
||||
FHyperTwistMemoryDerivedAdjunctState
|
||||
UHyperTwistContractLibrary::MakeSampleTrainingMemoryDerivedAdjunctState()
|
||||
{
|
||||
FHyperTwistTrainingRepositoryState RepositoryState = MakeSampleTrainingRepositoryState();
|
||||
RepositoryState = HyperTwistContractLibraryInternal::AppendSampleCoachArtifacts(RepositoryState);
|
||||
|
||||
const FHyperTwistCoachBrief FollowUpBrief = MakeSampleTrainingCoachFollowUpBrief();
|
||||
const FHyperTwistTrainingCoachActionPlan FollowUpPlan =
|
||||
UHyperTwistTrainingRepositoryLibrary::BuildCoachActionPlan(
|
||||
FollowUpBrief,
|
||||
MakeSampleTrainingCoachMemorySnapshot(),
|
||||
TEXT("coach_follow_up_training_session_02"),
|
||||
TEXT("2026-04-28T12:20:00Z"),
|
||||
0,
|
||||
0,
|
||||
FString(),
|
||||
FollowUpBrief.FocusCaseIds
|
||||
);
|
||||
if (FollowUpPlan.IsStructurallyValid())
|
||||
{
|
||||
RepositoryState = UHyperTwistTrainingRepositoryLibrary::UpsertCoachActionPlan(
|
||||
RepositoryState,
|
||||
FollowUpPlan
|
||||
);
|
||||
}
|
||||
|
||||
const FString UserId =
|
||||
HyperTwistContractLibraryInternal::ResolveSampleRepositoryUserId(RepositoryState);
|
||||
if (UserId.IsEmpty())
|
||||
{
|
||||
return FHyperTwistMemoryDerivedAdjunctState();
|
||||
}
|
||||
|
||||
return UHyperTwistMemoryCoreLibrary::DeriveMemoryDerivedAdjunctState(
|
||||
RepositoryState,
|
||||
UserId,
|
||||
TEXT("2026-04-28T12:40:00Z"),
|
||||
EHyperTwistMemoryContextAssemblyProfile::MaxRetentionMode
|
||||
);
|
||||
}
|
||||
|
||||
FHyperTwistTrainingRepositoryIntegrityReport UHyperTwistContractLibrary::MakeSampleTrainingRepositoryIntegrityReport()
|
||||
{
|
||||
FHyperTwistTrainingRepositoryState RepositoryState = MakeSampleTrainingRepositoryState();
|
||||
|
|
@ -4968,6 +5009,15 @@ FString UHyperTwistContractLibrary::SerializeMemoryKnowledgeNotesStateToJson(
|
|||
);
|
||||
}
|
||||
|
||||
FString UHyperTwistContractLibrary::SerializeMemoryDerivedAdjunctStateToJson(
|
||||
const FHyperTwistMemoryDerivedAdjunctState& DerivedAdjunctState
|
||||
)
|
||||
{
|
||||
return HyperTwistContractLibraryInternal::SerializeStructToJson(
|
||||
DerivedAdjunctState
|
||||
);
|
||||
}
|
||||
|
||||
FString UHyperTwistContractLibrary::SerializeTrainingTimerExportPacketToJson(
|
||||
const FHyperTwistTrainingTimerExportPacket& TimerExportPacket
|
||||
)
|
||||
|
|
@ -5079,6 +5129,17 @@ bool UHyperTwistContractLibrary::DeserializeMemoryKnowledgeNotesStateFromJson(
|
|||
);
|
||||
}
|
||||
|
||||
bool UHyperTwistContractLibrary::DeserializeMemoryDerivedAdjunctStateFromJson(
|
||||
const FString& Json,
|
||||
FHyperTwistMemoryDerivedAdjunctState& OutDerivedAdjunctState
|
||||
)
|
||||
{
|
||||
return HyperTwistContractLibraryInternal::DeserializeStructFromJson(
|
||||
Json,
|
||||
OutDerivedAdjunctState
|
||||
);
|
||||
}
|
||||
|
||||
bool UHyperTwistContractLibrary::DeserializeTrainingTimerExportPacketFromJson(
|
||||
const FString& Json,
|
||||
FHyperTwistTrainingTimerExportPacket& OutTimerExportPacket
|
||||
|
|
|
|||
|
|
@ -383,6 +383,57 @@ namespace HyperTwistMemoryCoreLibraryInternal
|
|||
);
|
||||
}
|
||||
|
||||
bool IsFeatureGateEnabledForProfile(
|
||||
const FString& GateId,
|
||||
const FHyperTwistMemoryFeatureGate& FeatureGate,
|
||||
const FHyperTwistMemorySettingsProfile& EconomicRetentionProfile,
|
||||
const FHyperTwistMemorySettingsProfile& MaxRetentionProfile,
|
||||
const EHyperTwistMemoryContextAssemblyProfile ContextAssemblyProfile
|
||||
)
|
||||
{
|
||||
const FHyperTwistMemorySettingsProfile* ActiveProfile = nullptr;
|
||||
switch (ContextAssemblyProfile)
|
||||
{
|
||||
case EHyperTwistMemoryContextAssemblyProfile::EconomicRetentionMode:
|
||||
ActiveProfile = &EconomicRetentionProfile;
|
||||
break;
|
||||
case EHyperTwistMemoryContextAssemblyProfile::MaxRetentionMode:
|
||||
ActiveProfile = &MaxRetentionProfile;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (ActiveProfile == nullptr)
|
||||
{
|
||||
return FeatureGate.DefaultState !=
|
||||
EHyperTwistMemoryFeatureGateDefaultState::DisabledByDefault;
|
||||
}
|
||||
|
||||
if (ActiveProfile->DisabledFeatureGateIds.Contains(GateId))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (ActiveProfile->EnabledFeatureGateIds.Contains(GateId))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return FeatureGate.DefaultState !=
|
||||
EHyperTwistMemoryFeatureGateDefaultState::DisabledByDefault;
|
||||
}
|
||||
|
||||
void AppendSourceEntityIdsFromProvenance(
|
||||
TArray<FString>& OutSourceEntityIds,
|
||||
const TArray<FHyperTwistMemoryProvenanceLink>& ProvenanceLinks
|
||||
)
|
||||
{
|
||||
for (const FHyperTwistMemoryProvenanceLink& ProvenanceLink : ProvenanceLinks)
|
||||
{
|
||||
AddUniqueString(OutSourceEntityIds, ProvenanceLink.ParentEntityId);
|
||||
}
|
||||
}
|
||||
|
||||
int32 ResolveLanePriority(const EHyperTwistMemoryLane Lane)
|
||||
{
|
||||
switch (Lane)
|
||||
|
|
@ -4479,3 +4530,592 @@ FHyperTwistMemoryKnowledgeNotesState
|
|||
|
||||
return KnowledgeNotesState;
|
||||
}
|
||||
|
||||
FHyperTwistMemoryDerivedAdjunctState
|
||||
UHyperTwistMemoryCoreLibrary::DeriveMemoryDerivedAdjunctState(
|
||||
const FHyperTwistTrainingRepositoryState& RepositoryState,
|
||||
const FString& UserId,
|
||||
const FString& ReferenceUtc,
|
||||
const EHyperTwistMemoryContextAssemblyProfile ContextAssemblyProfile
|
||||
)
|
||||
{
|
||||
FHyperTwistMemoryDerivedAdjunctState DerivedAdjunctState;
|
||||
if (UserId.IsEmpty()
|
||||
|| ContextAssemblyProfile == EHyperTwistMemoryContextAssemblyProfile::None)
|
||||
{
|
||||
return DerivedAdjunctState;
|
||||
}
|
||||
|
||||
const FString ResolvedReferenceUtc =
|
||||
HyperTwistMemoryCoreLibraryInternal::ResolveReferenceUtc(ReferenceUtc);
|
||||
DerivedAdjunctState.UserId = UserId;
|
||||
DerivedAdjunctState.ReferenceUtc = ResolvedReferenceUtc;
|
||||
DerivedAdjunctState.ContextAssemblyProfile = ContextAssemblyProfile;
|
||||
|
||||
const FHyperTwistMemoryLedgerState MemoryLedgerState = DeriveMemoryLedgerState(
|
||||
RepositoryState,
|
||||
UserId,
|
||||
ResolvedReferenceUtc
|
||||
);
|
||||
const FHyperTwistMemoryChronicleContinuityState ChronicleState =
|
||||
DeriveMemoryChronicleContinuityState(
|
||||
RepositoryState,
|
||||
UserId,
|
||||
ResolvedReferenceUtc
|
||||
);
|
||||
const FHyperTwistMemoryRecallSharedContextState RecallState =
|
||||
DeriveMemoryRecallSharedContextState(
|
||||
RepositoryState,
|
||||
UserId,
|
||||
ResolvedReferenceUtc,
|
||||
TEXT("resume review coach history")
|
||||
);
|
||||
const FHyperTwistMemoryCognitiveConsolidationState CognitiveState =
|
||||
DeriveMemoryCognitiveConsolidationState(
|
||||
RepositoryState,
|
||||
UserId,
|
||||
ResolvedReferenceUtc
|
||||
);
|
||||
const FHyperTwistMemoryKnowledgeNotesState KnowledgeNotesState =
|
||||
DeriveMemoryKnowledgeNotesState(
|
||||
RepositoryState,
|
||||
UserId,
|
||||
ResolvedReferenceUtc
|
||||
);
|
||||
|
||||
if (!ChronicleState.IsStructurallyValid()
|
||||
|| !RecallState.IsStructurallyValid()
|
||||
|| !CognitiveState.IsStructurallyValid()
|
||||
|| !KnowledgeNotesState.IsStructurallyValid())
|
||||
{
|
||||
return FHyperTwistMemoryDerivedAdjunctState();
|
||||
}
|
||||
|
||||
TMap<FString, FHyperTwistMemoryEntityDescriptor> LedgerEntitiesById;
|
||||
for (const FHyperTwistMemoryEntityDescriptor& Entity : MemoryLedgerState.Entities)
|
||||
{
|
||||
LedgerEntitiesById.Add(Entity.EntityId, Entity);
|
||||
}
|
||||
|
||||
const FHyperTwistMemoryLaneContract* DerivedLaneContract =
|
||||
MemoryLedgerState.LaneContracts.FindByPredicate(
|
||||
[](const FHyperTwistMemoryLaneContract& LaneContract)
|
||||
{
|
||||
return LaneContract.Lane == EHyperTwistMemoryLane::DerivedCompacted;
|
||||
}
|
||||
);
|
||||
const FHyperTwistMemoryFeatureGate* DerivedGate =
|
||||
MemoryLedgerState.FeatureGates.FindByPredicate(
|
||||
[](const FHyperTwistMemoryFeatureGate& FeatureGate)
|
||||
{
|
||||
return FeatureGate.Lane == EHyperTwistMemoryLane::DerivedCompacted;
|
||||
}
|
||||
);
|
||||
const FHyperTwistMemoryEntityDescriptor* PolicyEntity =
|
||||
MemoryLedgerState.Entities.FindByPredicate(
|
||||
[](const FHyperTwistMemoryEntityDescriptor& Entity)
|
||||
{
|
||||
return Entity.RecordKind == TEXT("memory-policy-profile");
|
||||
}
|
||||
);
|
||||
const FHyperTwistMemoryEntityDescriptor* LedgerContractEntity =
|
||||
MemoryLedgerState.Entities.FindByPredicate(
|
||||
[](const FHyperTwistMemoryEntityDescriptor& Entity)
|
||||
{
|
||||
return Entity.RecordKind == TEXT("memory-ledger-contract");
|
||||
}
|
||||
);
|
||||
|
||||
if (DerivedLaneContract == nullptr
|
||||
|| DerivedGate == nullptr
|
||||
|| PolicyEntity == nullptr
|
||||
|| LedgerContractEntity == nullptr
|
||||
|| DerivedLaneContract->AuthorityKind !=
|
||||
EHyperTwistMemoryAuthorityKind::DerivedOnly)
|
||||
{
|
||||
return FHyperTwistMemoryDerivedAdjunctState();
|
||||
}
|
||||
|
||||
DerivedAdjunctState.FeatureGateId = DerivedGate->GateId;
|
||||
DerivedAdjunctState.SettingsKey = DerivedGate->SettingsKey;
|
||||
DerivedAdjunctState.bDerivedOnlyStorageConfirmed = true;
|
||||
DerivedAdjunctState.bRemovableWithoutLineageLoss =
|
||||
DerivedGate->bDisableAllowed && DerivedGate->bUserControllable;
|
||||
DerivedAdjunctState.bAllFeaturesOffSafe = true;
|
||||
DerivedAdjunctState.bDerivedGateActive =
|
||||
HyperTwistMemoryCoreLibraryInternal::IsFeatureGateEnabledForProfile(
|
||||
DerivedGate->GateId,
|
||||
*DerivedGate,
|
||||
MemoryLedgerState.EconomicRetentionProfile,
|
||||
MemoryLedgerState.MaxRetentionProfile,
|
||||
ContextAssemblyProfile
|
||||
);
|
||||
|
||||
if (!DerivedAdjunctState.bDerivedGateActive)
|
||||
{
|
||||
if (!DerivedAdjunctState.IsStructurallyValid())
|
||||
{
|
||||
return FHyperTwistMemoryDerivedAdjunctState();
|
||||
}
|
||||
|
||||
return DerivedAdjunctState;
|
||||
}
|
||||
|
||||
auto AppendProvenanceLinks =
|
||||
[](
|
||||
TArray<FHyperTwistMemoryProvenanceLink>& OutProvenanceLinks,
|
||||
const TArray<FHyperTwistMemoryProvenanceLink>& ProvenanceLinks)
|
||||
{
|
||||
for (const FHyperTwistMemoryProvenanceLink& ProvenanceLink : ProvenanceLinks)
|
||||
{
|
||||
HyperTwistMemoryCoreLibraryInternal::AddUniqueProvenanceLink(
|
||||
OutProvenanceLinks,
|
||||
ProvenanceLink
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
auto EnsureFallbackProvenance =
|
||||
[&](
|
||||
TArray<FString>& SourceEntityIds,
|
||||
TArray<FHyperTwistMemoryProvenanceLink>& ProvenanceLinks)
|
||||
{
|
||||
HyperTwistMemoryCoreLibraryInternal::TryAppendEntityProvenance(
|
||||
LedgerEntitiesById,
|
||||
PolicyEntity->EntityId,
|
||||
TEXT("memory-policy-profile"),
|
||||
ProvenanceLinks
|
||||
);
|
||||
HyperTwistMemoryCoreLibraryInternal::TryAppendEntityProvenance(
|
||||
LedgerEntitiesById,
|
||||
LedgerContractEntity->EntityId,
|
||||
TEXT("memory-ledger-contract"),
|
||||
ProvenanceLinks
|
||||
);
|
||||
HyperTwistMemoryCoreLibraryInternal::AppendSourceEntityIdsFromProvenance(
|
||||
SourceEntityIds,
|
||||
ProvenanceLinks
|
||||
);
|
||||
};
|
||||
|
||||
auto JoinTopValues =
|
||||
[](const TArray<FString>& Values, const int32 MaxValues)
|
||||
{
|
||||
FString Joined;
|
||||
const int32 ValueCount = FMath::Min(MaxValues, Values.Num());
|
||||
for (int32 Index = 0; Index < ValueCount; ++Index)
|
||||
{
|
||||
if (!Joined.IsEmpty())
|
||||
{
|
||||
Joined += TEXT(", ");
|
||||
}
|
||||
Joined += Values[Index];
|
||||
}
|
||||
return Joined;
|
||||
};
|
||||
|
||||
auto AddCompactSummary =
|
||||
[&](const FHyperTwistMemoryCompactSummary& CompactSummary)
|
||||
{
|
||||
if (!CompactSummary.IsStructurallyValid()
|
||||
|| DerivedAdjunctState.CompactSummaries.ContainsByPredicate(
|
||||
[&CompactSummary](const FHyperTwistMemoryCompactSummary& ExistingSummary)
|
||||
{
|
||||
return ExistingSummary.SummaryId == CompactSummary.SummaryId;
|
||||
}))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DerivedAdjunctState.CompactSummaries.Add(CompactSummary);
|
||||
};
|
||||
|
||||
auto AddReducedContextPacket =
|
||||
[&](const FHyperTwistMemoryReducedContextPacket& ReducedContextPacket)
|
||||
{
|
||||
if (!ReducedContextPacket.IsStructurallyValid()
|
||||
|| DerivedAdjunctState.ReducedContextPackets.ContainsByPredicate(
|
||||
[&ReducedContextPacket](
|
||||
const FHyperTwistMemoryReducedContextPacket& ExistingPacket)
|
||||
{
|
||||
return ExistingPacket.PacketId == ReducedContextPacket.PacketId;
|
||||
}))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DerivedAdjunctState.ReducedContextPackets.Add(ReducedContextPacket);
|
||||
};
|
||||
|
||||
auto AddDigestView =
|
||||
[&](const FHyperTwistMemoryDigestView& DigestView)
|
||||
{
|
||||
if (!DigestView.IsStructurallyValid()
|
||||
|| DerivedAdjunctState.DigestViews.ContainsByPredicate(
|
||||
[&DigestView](const FHyperTwistMemoryDigestView& ExistingDigestView)
|
||||
{
|
||||
return ExistingDigestView.DigestId == DigestView.DigestId;
|
||||
}))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DerivedAdjunctState.DigestViews.Add(DigestView);
|
||||
};
|
||||
|
||||
auto MakeCompactSummary =
|
||||
[&](const FString& SummaryId,
|
||||
const FString& SummaryKind,
|
||||
const FString& Headline,
|
||||
const FString& SummaryText,
|
||||
const TArray<FHyperTwistMemoryProvenanceLink>& ProvenanceLinks)
|
||||
{
|
||||
FHyperTwistMemoryCompactSummary CompactSummary;
|
||||
CompactSummary.SummaryId = SummaryId;
|
||||
CompactSummary.SummaryKind = SummaryKind;
|
||||
CompactSummary.Headline = Headline;
|
||||
CompactSummary.SummaryText = SummaryText;
|
||||
CompactSummary.UserId = UserId;
|
||||
CompactSummary.ReferenceUtc = ResolvedReferenceUtc;
|
||||
AppendProvenanceLinks(CompactSummary.ProvenanceLinks, ProvenanceLinks);
|
||||
EnsureFallbackProvenance(
|
||||
CompactSummary.SourceEntityIds,
|
||||
CompactSummary.ProvenanceLinks
|
||||
);
|
||||
return CompactSummary;
|
||||
};
|
||||
|
||||
auto MakeReducedContextPacket =
|
||||
[&](const FString& PacketId,
|
||||
const FString& PacketKind,
|
||||
const FString& Headline,
|
||||
const FString& PacketBody,
|
||||
const int32 MaxTokenHint,
|
||||
const TArray<FHyperTwistMemoryProvenanceLink>& ProvenanceLinks)
|
||||
{
|
||||
FHyperTwistMemoryReducedContextPacket ReducedContextPacket;
|
||||
ReducedContextPacket.PacketId = PacketId;
|
||||
ReducedContextPacket.PacketKind = PacketKind;
|
||||
ReducedContextPacket.Headline = Headline;
|
||||
ReducedContextPacket.PacketBody = PacketBody;
|
||||
ReducedContextPacket.UserId = UserId;
|
||||
ReducedContextPacket.ReferenceUtc = ResolvedReferenceUtc;
|
||||
ReducedContextPacket.MaxTokenHint = MaxTokenHint;
|
||||
AppendProvenanceLinks(
|
||||
ReducedContextPacket.ProvenanceLinks,
|
||||
ProvenanceLinks
|
||||
);
|
||||
EnsureFallbackProvenance(
|
||||
ReducedContextPacket.SourceEntityIds,
|
||||
ReducedContextPacket.ProvenanceLinks
|
||||
);
|
||||
return ReducedContextPacket;
|
||||
};
|
||||
|
||||
auto MakeDigestView =
|
||||
[&](const FString& DigestId,
|
||||
const FString& DigestKind,
|
||||
const FString& Title,
|
||||
const FString& SummaryLine,
|
||||
const TArray<FHyperTwistMemoryProvenanceLink>& ProvenanceLinks)
|
||||
{
|
||||
FHyperTwistMemoryDigestView DigestView;
|
||||
DigestView.DigestId = DigestId;
|
||||
DigestView.DigestKind = DigestKind;
|
||||
DigestView.Title = Title;
|
||||
DigestView.SummaryLine = SummaryLine;
|
||||
DigestView.UserId = UserId;
|
||||
DigestView.ReferenceUtc = ResolvedReferenceUtc;
|
||||
AppendProvenanceLinks(DigestView.ProvenanceLinks, ProvenanceLinks);
|
||||
EnsureFallbackProvenance(
|
||||
DigestView.SourceEntityIds,
|
||||
DigestView.ProvenanceLinks
|
||||
);
|
||||
return DigestView;
|
||||
};
|
||||
|
||||
TArray<FString> RecallHeadlines;
|
||||
for (int32 MatchIndex = 0;
|
||||
MatchIndex < FMath::Min(2, RecallState.RecallMatches.Num());
|
||||
++MatchIndex)
|
||||
{
|
||||
HyperTwistMemoryCoreLibraryInternal::AddUniqueString(
|
||||
RecallHeadlines,
|
||||
RecallState.RecallMatches[MatchIndex].Headline
|
||||
);
|
||||
}
|
||||
|
||||
TArray<FString> KnowledgeTitles;
|
||||
for (int32 ObjectIndex = 0;
|
||||
ObjectIndex < FMath::Min(3, KnowledgeNotesState.KnowledgeObjects.Num());
|
||||
++ObjectIndex)
|
||||
{
|
||||
HyperTwistMemoryCoreLibraryInternal::AddUniqueString(
|
||||
KnowledgeTitles,
|
||||
KnowledgeNotesState.KnowledgeObjects[ObjectIndex].Title
|
||||
);
|
||||
}
|
||||
|
||||
const FHyperTwistMemoryResumePack* PrimaryResumePack =
|
||||
ChronicleState.ResumePacks.Num() > 0 ? &ChronicleState.ResumePacks[0] : nullptr;
|
||||
const FHyperTwistMemoryRecallMatch* TopRecallMatch =
|
||||
RecallState.RecallMatches.Num() > 0 ? &RecallState.RecallMatches[0] : nullptr;
|
||||
const FHyperTwistMemoryCognitiveFact* ActiveFact =
|
||||
CognitiveState.Facts.FindByPredicate(
|
||||
[](const FHyperTwistMemoryCognitiveFact& Fact)
|
||||
{
|
||||
return Fact.bActive;
|
||||
}
|
||||
);
|
||||
|
||||
TArray<FHyperTwistMemoryProvenanceLink> OverviewProvenance;
|
||||
AppendProvenanceLinks(OverviewProvenance, KnowledgeNotesState.UserNotesPosture.ProvenanceLinks);
|
||||
if (ChronicleState.ChronicleEvents.Num() > 0)
|
||||
{
|
||||
AppendProvenanceLinks(
|
||||
OverviewProvenance,
|
||||
ChronicleState.ChronicleEvents[0].ProvenanceLinks
|
||||
);
|
||||
}
|
||||
if (ActiveFact != nullptr)
|
||||
{
|
||||
AppendProvenanceLinks(OverviewProvenance, ActiveFact->ProvenanceLinks);
|
||||
}
|
||||
if (KnowledgeNotesState.KnowledgeObjects.Num() > 0)
|
||||
{
|
||||
AppendProvenanceLinks(
|
||||
OverviewProvenance,
|
||||
KnowledgeNotesState.KnowledgeObjects[0].ProvenanceLinks
|
||||
);
|
||||
}
|
||||
|
||||
AddCompactSummary(
|
||||
MakeCompactSummary(
|
||||
FString::Printf(TEXT("memory-compact-summary/overview/%s"), *UserId),
|
||||
TEXT("memory-overview"),
|
||||
TEXT("Derived memory overview"),
|
||||
FString::Printf(
|
||||
TEXT("Ledger=%d/%d/%d entities, chronicle=%d events, recall=%d matches, activeFacts=%d, curatedKnowledge=%d."),
|
||||
MemoryLedgerState.AuthoritativeEntityCount,
|
||||
MemoryLedgerState.SemiAuthoritativeEntityCount,
|
||||
MemoryLedgerState.DerivedEntityCount,
|
||||
ChronicleState.ChronicleEvents.Num(),
|
||||
RecallState.RecallMatches.Num(),
|
||||
CognitiveState.ActiveFactCount,
|
||||
KnowledgeNotesState.CuratedReferenceObjectCount
|
||||
),
|
||||
OverviewProvenance
|
||||
)
|
||||
);
|
||||
|
||||
TArray<FHyperTwistMemoryProvenanceLink> ResumeSummaryProvenance;
|
||||
if (PrimaryResumePack != nullptr)
|
||||
{
|
||||
AppendProvenanceLinks(ResumeSummaryProvenance, PrimaryResumePack->ProvenanceLinks);
|
||||
}
|
||||
if (RecallState.SharedContextProjections.Num() > 0)
|
||||
{
|
||||
AppendProvenanceLinks(
|
||||
ResumeSummaryProvenance,
|
||||
RecallState.SharedContextProjections[0].ProvenanceLinks
|
||||
);
|
||||
}
|
||||
|
||||
AddCompactSummary(
|
||||
MakeCompactSummary(
|
||||
FString::Printf(TEXT("memory-compact-summary/resume/%s"), *UserId),
|
||||
TEXT("active-resume"),
|
||||
TEXT("Continuity and resume overview"),
|
||||
FString::Printf(
|
||||
TEXT("OpenSessionGroups=%d, ResumePacks=%d, BlockingGuards=%d, SharedProjections=%d."),
|
||||
ChronicleState.OpenSessionGroupCount,
|
||||
ChronicleState.ResumeRequiredCount,
|
||||
ChronicleState.BlockingGuardCount,
|
||||
RecallState.SharedContextProjectionCount
|
||||
),
|
||||
ResumeSummaryProvenance
|
||||
)
|
||||
);
|
||||
|
||||
TArray<FHyperTwistMemoryProvenanceLink> KnowledgeSummaryProvenance;
|
||||
if (KnowledgeNotesState.KnowledgeObjects.Num() > 0)
|
||||
{
|
||||
AppendProvenanceLinks(
|
||||
KnowledgeSummaryProvenance,
|
||||
KnowledgeNotesState.KnowledgeObjects[0].ProvenanceLinks
|
||||
);
|
||||
}
|
||||
if (KnowledgeNotesState.PromotionReviews.Num() > 0)
|
||||
{
|
||||
AppendProvenanceLinks(
|
||||
KnowledgeSummaryProvenance,
|
||||
KnowledgeNotesState.PromotionReviews[0].ProvenanceLinks
|
||||
);
|
||||
}
|
||||
AppendProvenanceLinks(
|
||||
KnowledgeSummaryProvenance,
|
||||
KnowledgeNotesState.UserNotesPosture.ProvenanceLinks
|
||||
);
|
||||
|
||||
AddCompactSummary(
|
||||
MakeCompactSummary(
|
||||
FString::Printf(TEXT("memory-compact-summary/knowledge/%s"), *UserId),
|
||||
TEXT("knowledge-promotion"),
|
||||
TEXT("Knowledge and notes overview"),
|
||||
FString::Printf(
|
||||
TEXT("Curated=%d, approved=%d, deferred=%d, blocked=%d, userNotes=%s."),
|
||||
KnowledgeNotesState.CuratedReferenceObjectCount,
|
||||
KnowledgeNotesState.ApprovedPromotionCount,
|
||||
KnowledgeNotesState.DeferredPromotionCount,
|
||||
KnowledgeNotesState.BlockedPromotionCount,
|
||||
KnowledgeNotesState.bUserNotesLaneAvailable
|
||||
? TEXT("active")
|
||||
: TEXT("separately-gated")
|
||||
),
|
||||
KnowledgeSummaryProvenance
|
||||
)
|
||||
);
|
||||
|
||||
TArray<FHyperTwistMemoryProvenanceLink> CoachResumePacketProvenance;
|
||||
if (PrimaryResumePack != nullptr)
|
||||
{
|
||||
AppendProvenanceLinks(
|
||||
CoachResumePacketProvenance,
|
||||
PrimaryResumePack->ProvenanceLinks
|
||||
);
|
||||
}
|
||||
if (TopRecallMatch != nullptr)
|
||||
{
|
||||
AppendProvenanceLinks(
|
||||
CoachResumePacketProvenance,
|
||||
TopRecallMatch->ProvenanceLinks
|
||||
);
|
||||
}
|
||||
if (ActiveFact != nullptr)
|
||||
{
|
||||
AppendProvenanceLinks(CoachResumePacketProvenance, ActiveFact->ProvenanceLinks);
|
||||
}
|
||||
AppendProvenanceLinks(
|
||||
CoachResumePacketProvenance,
|
||||
KnowledgeNotesState.UserNotesPosture.ProvenanceLinks
|
||||
);
|
||||
|
||||
const FString ResumeHeadline =
|
||||
PrimaryResumePack != nullptr
|
||||
? PrimaryResumePack->Headline
|
||||
: TEXT("No active resume pack");
|
||||
const FString ActiveFactHeadline =
|
||||
ActiveFact != nullptr
|
||||
? ActiveFact->Headline
|
||||
: TEXT("No active cognitive fact");
|
||||
|
||||
AddReducedContextPacket(
|
||||
MakeReducedContextPacket(
|
||||
FString::Printf(TEXT("memory-reduced-context/coach-resume/%s"), *UserId),
|
||||
TEXT("coach-resume-context"),
|
||||
TEXT("Coach resume packet"),
|
||||
FString::Printf(
|
||||
TEXT("Resume=%s. RecallHighlights=%s. ActiveFact=%s. Notes=%s"),
|
||||
*ResumeHeadline,
|
||||
*JoinTopValues(RecallHeadlines, 2),
|
||||
*ActiveFactHeadline,
|
||||
*KnowledgeNotesState.UserNotesPosture.SummaryLine
|
||||
),
|
||||
240,
|
||||
CoachResumePacketProvenance
|
||||
)
|
||||
);
|
||||
|
||||
TArray<FHyperTwistMemoryProvenanceLink> ReviewPacketProvenance;
|
||||
if (KnowledgeNotesState.KnowledgeObjects.Num() > 0)
|
||||
{
|
||||
AppendProvenanceLinks(
|
||||
ReviewPacketProvenance,
|
||||
KnowledgeNotesState.KnowledgeObjects[0].ProvenanceLinks
|
||||
);
|
||||
}
|
||||
if (KnowledgeNotesState.PromotionReviews.Num() > 0)
|
||||
{
|
||||
AppendProvenanceLinks(
|
||||
ReviewPacketProvenance,
|
||||
KnowledgeNotesState.PromotionReviews[0].ProvenanceLinks
|
||||
);
|
||||
}
|
||||
if (CognitiveState.Contradictions.Num() > 0)
|
||||
{
|
||||
AppendProvenanceLinks(
|
||||
ReviewPacketProvenance,
|
||||
CognitiveState.Contradictions[0].ProvenanceLinks
|
||||
);
|
||||
}
|
||||
|
||||
AddReducedContextPacket(
|
||||
MakeReducedContextPacket(
|
||||
FString::Printf(TEXT("memory-reduced-context/review/%s"), *UserId),
|
||||
TEXT("knowledge-review-context"),
|
||||
TEXT("Knowledge review packet"),
|
||||
FString::Printf(
|
||||
TEXT("Knowledge=%s. Promotions approved/deferred/blocked=%d/%d/%d. OpenCognitiveReview=%s."),
|
||||
*JoinTopValues(KnowledgeTitles, 3),
|
||||
KnowledgeNotesState.ApprovedPromotionCount,
|
||||
KnowledgeNotesState.DeferredPromotionCount,
|
||||
KnowledgeNotesState.BlockedPromotionCount,
|
||||
CognitiveState.bHasOpenCognitiveReview ? TEXT("yes") : TEXT("no")
|
||||
),
|
||||
220,
|
||||
ReviewPacketProvenance
|
||||
)
|
||||
);
|
||||
|
||||
TArray<FHyperTwistMemoryProvenanceLink> CoachDigestProvenance =
|
||||
CoachResumePacketProvenance;
|
||||
AddDigestView(
|
||||
MakeDigestView(
|
||||
FString::Printf(TEXT("memory-digest/coach/%s"), *UserId),
|
||||
TEXT("coach-memory-digest"),
|
||||
TEXT("Coach memory digest"),
|
||||
FString::Printf(
|
||||
TEXT("resume=%d recall=%d activeFacts=%d blockingGuards=%d"),
|
||||
ChronicleState.ResumeRequiredCount,
|
||||
RecallState.RecallResultCount,
|
||||
CognitiveState.ActiveFactCount,
|
||||
ChronicleState.BlockingGuardCount
|
||||
),
|
||||
CoachDigestProvenance
|
||||
)
|
||||
);
|
||||
|
||||
TArray<FHyperTwistMemoryProvenanceLink> KnowledgeDigestProvenance =
|
||||
KnowledgeSummaryProvenance;
|
||||
AddDigestView(
|
||||
MakeDigestView(
|
||||
FString::Printf(TEXT("memory-digest/knowledge/%s"), *UserId),
|
||||
TEXT("knowledge-memory-digest"),
|
||||
TEXT("Knowledge memory digest"),
|
||||
FString::Printf(
|
||||
TEXT("knowledge=%d approved=%d deferred=%d blocked=%d notes=%s"),
|
||||
KnowledgeNotesState.CuratedReferenceObjectCount,
|
||||
KnowledgeNotesState.ApprovedPromotionCount,
|
||||
KnowledgeNotesState.DeferredPromotionCount,
|
||||
KnowledgeNotesState.BlockedPromotionCount,
|
||||
KnowledgeNotesState.bUserNotesLaneAvailable
|
||||
? TEXT("active")
|
||||
: TEXT("gated")
|
||||
),
|
||||
KnowledgeDigestProvenance
|
||||
)
|
||||
);
|
||||
|
||||
DerivedAdjunctState.CompactSummaryCount =
|
||||
DerivedAdjunctState.CompactSummaries.Num();
|
||||
DerivedAdjunctState.ReducedContextPacketCount =
|
||||
DerivedAdjunctState.ReducedContextPackets.Num();
|
||||
DerivedAdjunctState.DigestViewCount = DerivedAdjunctState.DigestViews.Num();
|
||||
|
||||
if (!DerivedAdjunctState.IsStructurallyValid())
|
||||
{
|
||||
return FHyperTwistMemoryDerivedAdjunctState();
|
||||
}
|
||||
|
||||
return DerivedAdjunctState;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,6 +160,9 @@ public:
|
|||
UFUNCTION(BlueprintPure, Category = "HyperTwist|Memory")
|
||||
static FHyperTwistMemoryKnowledgeNotesState MakeSampleTrainingMemoryKnowledgeNotesState();
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "HyperTwist|Memory")
|
||||
static FHyperTwistMemoryDerivedAdjunctState MakeSampleTrainingMemoryDerivedAdjunctState();
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "HyperTwist|Training")
|
||||
static FHyperTwistTrainingRepositoryIntegrityReport MakeSampleTrainingRepositoryIntegrityReport();
|
||||
|
||||
|
|
@ -344,6 +347,11 @@ public:
|
|||
const FHyperTwistMemoryKnowledgeNotesState& KnowledgeNotesState
|
||||
);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "HyperTwist|Serialization")
|
||||
static FString SerializeMemoryDerivedAdjunctStateToJson(
|
||||
const FHyperTwistMemoryDerivedAdjunctState& DerivedAdjunctState
|
||||
);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "HyperTwist|Serialization")
|
||||
static FString SerializeTrainingTimerExportPacketToJson(const FHyperTwistTrainingTimerExportPacket& TimerExportPacket);
|
||||
|
||||
|
|
@ -410,6 +418,12 @@ public:
|
|||
FHyperTwistMemoryKnowledgeNotesState& OutKnowledgeNotesState
|
||||
);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "HyperTwist|Serialization")
|
||||
static bool DeserializeMemoryDerivedAdjunctStateFromJson(
|
||||
const FString& Json,
|
||||
FHyperTwistMemoryDerivedAdjunctState& OutDerivedAdjunctState
|
||||
);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "HyperTwist|Serialization")
|
||||
static bool DeserializeTrainingTimerExportPacketFromJson(const FString& Json, FHyperTwistTrainingTimerExportPacket& OutTimerExportPacket);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -47,4 +47,12 @@ public:
|
|||
const FString& UserId,
|
||||
const FString& ReferenceUtc
|
||||
);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "HyperTwist|Memory")
|
||||
static FHyperTwistMemoryDerivedAdjunctState DeriveMemoryDerivedAdjunctState(
|
||||
const FHyperTwistTrainingRepositoryState& RepositoryState,
|
||||
const FString& UserId,
|
||||
const FString& ReferenceUtc,
|
||||
EHyperTwistMemoryContextAssemblyProfile ContextAssemblyProfile
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1809,3 +1809,319 @@ struct FHyperTwistMemoryKnowledgeNotesState
|
|||
&& bUserNotesLaneAvailable == bComputedUserNotesLaneAvailable;
|
||||
}
|
||||
};
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct FHyperTwistMemoryCompactSummary
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString SummaryId;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString SummaryKind;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString Headline;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString SummaryText;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString UserId;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString ReferenceUtc;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
EHyperTwistMemoryLane Lane = EHyperTwistMemoryLane::DerivedCompacted;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
EHyperTwistMemoryAuthorityKind AuthorityKind =
|
||||
EHyperTwistMemoryAuthorityKind::DerivedOnly;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
TArray<FString> SourceEntityIds;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
TArray<FHyperTwistMemoryProvenanceLink> ProvenanceLinks;
|
||||
|
||||
bool IsStructurallyValid() const
|
||||
{
|
||||
if (SummaryId.IsEmpty()
|
||||
|| SummaryKind.IsEmpty()
|
||||
|| Headline.IsEmpty()
|
||||
|| SummaryText.IsEmpty()
|
||||
|| UserId.IsEmpty()
|
||||
|| ReferenceUtc.IsEmpty()
|
||||
|| Lane != EHyperTwistMemoryLane::DerivedCompacted
|
||||
|| AuthorityKind != EHyperTwistMemoryAuthorityKind::DerivedOnly
|
||||
|| SourceEntityIds.Num() == 0
|
||||
|| ProvenanceLinks.Num() == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const FHyperTwistMemoryProvenanceLink& ProvenanceLink : ProvenanceLinks)
|
||||
{
|
||||
if (!ProvenanceLink.IsStructurallyValid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct FHyperTwistMemoryReducedContextPacket
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString PacketId;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString PacketKind;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString Headline;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString PacketBody;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString UserId;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString ReferenceUtc;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
EHyperTwistMemoryLane Lane = EHyperTwistMemoryLane::DerivedCompacted;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
EHyperTwistMemoryAuthorityKind AuthorityKind =
|
||||
EHyperTwistMemoryAuthorityKind::DerivedOnly;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
int32 MaxTokenHint = 0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
TArray<FString> SourceEntityIds;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
TArray<FHyperTwistMemoryProvenanceLink> ProvenanceLinks;
|
||||
|
||||
bool IsStructurallyValid() const
|
||||
{
|
||||
if (PacketId.IsEmpty()
|
||||
|| PacketKind.IsEmpty()
|
||||
|| Headline.IsEmpty()
|
||||
|| PacketBody.IsEmpty()
|
||||
|| UserId.IsEmpty()
|
||||
|| ReferenceUtc.IsEmpty()
|
||||
|| Lane != EHyperTwistMemoryLane::DerivedCompacted
|
||||
|| AuthorityKind != EHyperTwistMemoryAuthorityKind::DerivedOnly
|
||||
|| MaxTokenHint <= 0
|
||||
|| SourceEntityIds.Num() == 0
|
||||
|| ProvenanceLinks.Num() == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const FHyperTwistMemoryProvenanceLink& ProvenanceLink : ProvenanceLinks)
|
||||
{
|
||||
if (!ProvenanceLink.IsStructurallyValid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct FHyperTwistMemoryDigestView
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString DigestId;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString DigestKind;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString Title;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString SummaryLine;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString UserId;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString ReferenceUtc;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
EHyperTwistMemoryLane Lane = EHyperTwistMemoryLane::DerivedCompacted;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
EHyperTwistMemoryAuthorityKind AuthorityKind =
|
||||
EHyperTwistMemoryAuthorityKind::DerivedOnly;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
bool bUserVisible = true;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
bool bRemovable = true;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
TArray<FString> SourceEntityIds;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
TArray<FHyperTwistMemoryProvenanceLink> ProvenanceLinks;
|
||||
|
||||
bool IsStructurallyValid() const
|
||||
{
|
||||
if (DigestId.IsEmpty()
|
||||
|| DigestKind.IsEmpty()
|
||||
|| Title.IsEmpty()
|
||||
|| SummaryLine.IsEmpty()
|
||||
|| UserId.IsEmpty()
|
||||
|| ReferenceUtc.IsEmpty()
|
||||
|| Lane != EHyperTwistMemoryLane::DerivedCompacted
|
||||
|| AuthorityKind != EHyperTwistMemoryAuthorityKind::DerivedOnly
|
||||
|| !bUserVisible
|
||||
|| !bRemovable
|
||||
|| SourceEntityIds.Num() == 0
|
||||
|| ProvenanceLinks.Num() == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const FHyperTwistMemoryProvenanceLink& ProvenanceLink : ProvenanceLinks)
|
||||
{
|
||||
if (!ProvenanceLink.IsStructurallyValid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct FHyperTwistMemoryDerivedAdjunctState
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString UserId;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString ReferenceUtc;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
EHyperTwistMemoryContextAssemblyProfile ContextAssemblyProfile =
|
||||
EHyperTwistMemoryContextAssemblyProfile::None;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString FeatureGateId;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
FString SettingsKey;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
TArray<FHyperTwistMemoryCompactSummary> CompactSummaries;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
TArray<FHyperTwistMemoryReducedContextPacket> ReducedContextPackets;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
TArray<FHyperTwistMemoryDigestView> DigestViews;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
int32 CompactSummaryCount = 0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
int32 ReducedContextPacketCount = 0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
int32 DigestViewCount = 0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
bool bDerivedGateActive = false;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
bool bDerivedOnlyStorageConfirmed = false;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
bool bRemovableWithoutLineageLoss = false;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
|
||||
bool bAllFeaturesOffSafe = false;
|
||||
|
||||
bool IsStructurallyValid() const
|
||||
{
|
||||
if (UserId.IsEmpty()
|
||||
|| ReferenceUtc.IsEmpty()
|
||||
|| ContextAssemblyProfile == EHyperTwistMemoryContextAssemblyProfile::None
|
||||
|| FeatureGateId.IsEmpty()
|
||||
|| SettingsKey.IsEmpty()
|
||||
|| !bDerivedOnlyStorageConfirmed
|
||||
|| !bRemovableWithoutLineageLoss
|
||||
|| !bAllFeaturesOffSafe)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const FHyperTwistMemoryCompactSummary& CompactSummary : CompactSummaries)
|
||||
{
|
||||
if (!CompactSummary.IsStructurallyValid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (const FHyperTwistMemoryReducedContextPacket& ReducedContextPacket :
|
||||
ReducedContextPackets)
|
||||
{
|
||||
if (!ReducedContextPacket.IsStructurallyValid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (const FHyperTwistMemoryDigestView& DigestView : DigestViews)
|
||||
{
|
||||
if (!DigestView.IsStructurallyValid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const bool bCountsMatch =
|
||||
CompactSummaryCount == CompactSummaries.Num()
|
||||
&& ReducedContextPacketCount == ReducedContextPackets.Num()
|
||||
&& DigestViewCount == DigestViews.Num();
|
||||
if (!bCountsMatch)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bDerivedGateActive)
|
||||
{
|
||||
return CompactSummaryCount > 0
|
||||
&& ReducedContextPacketCount > 0
|
||||
&& DigestViewCount > 0;
|
||||
}
|
||||
|
||||
return CompactSummaryCount == 0
|
||||
&& ReducedContextPacketCount == 0
|
||||
&& DigestViewCount == 0;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,231 @@
|
|||
// Copyright HyperTwist, Inc. All Rights Reserved.
|
||||
|
||||
#include "Misc/AutomationTest.h"
|
||||
|
||||
#include "HyperTwistBootstrap/HyperTwistContractLibrary.h"
|
||||
#include "HyperTwistMemory/HyperTwistMemoryCoreLibrary.h"
|
||||
|
||||
#if WITH_AUTOMATION_TESTS
|
||||
|
||||
namespace HyperTwistMemoryPhase6RM6TestInternal
|
||||
{
|
||||
const FHyperTwistMemoryCompactSummary* FindCompactSummaryByKind(
|
||||
const FHyperTwistMemoryDerivedAdjunctState& DerivedAdjunctState,
|
||||
const FString& SummaryKind
|
||||
)
|
||||
{
|
||||
for (const FHyperTwistMemoryCompactSummary& CompactSummary :
|
||||
DerivedAdjunctState.CompactSummaries)
|
||||
{
|
||||
if (CompactSummary.SummaryKind == SummaryKind)
|
||||
{
|
||||
return &CompactSummary;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
IMPLEMENT_SIMPLE_AUTOMATION_TEST(
|
||||
FHyperTwistMemoryPhase6RM6ActiveDerivedViewsTest,
|
||||
"HyperTwist.FirstParty.Memory.Phase6R.M6.ActiveDerivedViews",
|
||||
EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter
|
||||
)
|
||||
|
||||
bool FHyperTwistMemoryPhase6RM6ActiveDerivedViewsTest::RunTest(
|
||||
const FString& Parameters
|
||||
)
|
||||
{
|
||||
const FHyperTwistMemoryDerivedAdjunctState DerivedAdjunctState =
|
||||
UHyperTwistContractLibrary::MakeSampleTrainingMemoryDerivedAdjunctState();
|
||||
|
||||
TestTrue(
|
||||
TEXT("The Phase 6R-M6 derived-adjunct state must be structurally valid."),
|
||||
DerivedAdjunctState.IsStructurallyValid()
|
||||
);
|
||||
TestEqual(
|
||||
TEXT("The sample M6 state must derive from max-retention mode."),
|
||||
DerivedAdjunctState.ContextAssemblyProfile,
|
||||
EHyperTwistMemoryContextAssemblyProfile::MaxRetentionMode
|
||||
);
|
||||
TestEqual(
|
||||
TEXT("The M6 state must bind to the canonical derived-compacted feature gate."),
|
||||
DerivedAdjunctState.FeatureGateId,
|
||||
TEXT("memory-gate/derived-compacted")
|
||||
);
|
||||
TestTrue(
|
||||
TEXT("The max-retention sample must keep derived adjuncts active."),
|
||||
DerivedAdjunctState.bDerivedGateActive
|
||||
);
|
||||
TestTrue(
|
||||
TEXT("The active M6 state must expose compact summaries."),
|
||||
DerivedAdjunctState.CompactSummaryCount > 0
|
||||
);
|
||||
TestTrue(
|
||||
TEXT("The active M6 state must expose reduced context packets."),
|
||||
DerivedAdjunctState.ReducedContextPacketCount > 0
|
||||
);
|
||||
TestTrue(
|
||||
TEXT("The active M6 state must expose digest views."),
|
||||
DerivedAdjunctState.DigestViewCount > 0
|
||||
);
|
||||
|
||||
const FHyperTwistMemoryCompactSummary* OverviewSummary =
|
||||
HyperTwistMemoryPhase6RM6TestInternal::FindCompactSummaryByKind(
|
||||
DerivedAdjunctState,
|
||||
TEXT("memory-overview")
|
||||
);
|
||||
TestNotNull(
|
||||
TEXT("A memory-overview compact summary must exist."),
|
||||
OverviewSummary
|
||||
);
|
||||
if (OverviewSummary != nullptr)
|
||||
{
|
||||
TestEqual(
|
||||
TEXT("Compact summaries must stay in the derived-compacted lane."),
|
||||
OverviewSummary->Lane,
|
||||
EHyperTwistMemoryLane::DerivedCompacted
|
||||
);
|
||||
TestEqual(
|
||||
TEXT("Compact summaries must remain derived-only."),
|
||||
OverviewSummary->AuthorityKind,
|
||||
EHyperTwistMemoryAuthorityKind::DerivedOnly
|
||||
);
|
||||
TestTrue(
|
||||
TEXT("Compact summaries must preserve provenance."),
|
||||
OverviewSummary->ProvenanceLinks.Num() > 0
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
IMPLEMENT_SIMPLE_AUTOMATION_TEST(
|
||||
FHyperTwistMemoryPhase6RM6AllFeaturesOffCorrectnessTest,
|
||||
"HyperTwist.FirstParty.Memory.Phase6R.M6.AllFeaturesOffCorrectness",
|
||||
EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter
|
||||
)
|
||||
|
||||
bool FHyperTwistMemoryPhase6RM6AllFeaturesOffCorrectnessTest::RunTest(
|
||||
const FString& Parameters
|
||||
)
|
||||
{
|
||||
const FHyperTwistTrainingRepositoryState RepositoryState =
|
||||
UHyperTwistContractLibrary::MakeSampleTrainingRepositoryState();
|
||||
const FHyperTwistMemoryDerivedAdjunctState DerivedAdjunctState =
|
||||
UHyperTwistMemoryCoreLibrary::DeriveMemoryDerivedAdjunctState(
|
||||
RepositoryState,
|
||||
TEXT("local-user"),
|
||||
TEXT("2026-04-28T12:40:00Z"),
|
||||
EHyperTwistMemoryContextAssemblyProfile::EconomicRetentionMode
|
||||
);
|
||||
|
||||
TestTrue(
|
||||
TEXT("The all-features-off M6 state must remain structurally valid."),
|
||||
DerivedAdjunctState.IsStructurallyValid()
|
||||
);
|
||||
TestEqual(
|
||||
TEXT("The all-features-off test must use economic-retention mode."),
|
||||
DerivedAdjunctState.ContextAssemblyProfile,
|
||||
EHyperTwistMemoryContextAssemblyProfile::EconomicRetentionMode
|
||||
);
|
||||
TestFalse(
|
||||
TEXT("Economic-retention mode must keep derived adjuncts disabled by default."),
|
||||
DerivedAdjunctState.bDerivedGateActive
|
||||
);
|
||||
TestEqual(
|
||||
TEXT("The disabled M6 state must expose zero compact summaries."),
|
||||
DerivedAdjunctState.CompactSummaryCount,
|
||||
0
|
||||
);
|
||||
TestEqual(
|
||||
TEXT("The disabled M6 state must expose zero reduced context packets."),
|
||||
DerivedAdjunctState.ReducedContextPacketCount,
|
||||
0
|
||||
);
|
||||
TestEqual(
|
||||
TEXT("The disabled M6 state must expose zero digest views."),
|
||||
DerivedAdjunctState.DigestViewCount,
|
||||
0
|
||||
);
|
||||
TestTrue(
|
||||
TEXT("The M6 state must confirm derived-only storage."),
|
||||
DerivedAdjunctState.bDerivedOnlyStorageConfirmed
|
||||
);
|
||||
TestTrue(
|
||||
TEXT("The M6 state must confirm removability without lineage loss."),
|
||||
DerivedAdjunctState.bRemovableWithoutLineageLoss
|
||||
);
|
||||
TestTrue(
|
||||
TEXT("The M6 state must confirm all-features-off correctness."),
|
||||
DerivedAdjunctState.bAllFeaturesOffSafe
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
IMPLEMENT_SIMPLE_AUTOMATION_TEST(
|
||||
FHyperTwistMemoryPhase6RM6SerializationRoundTripTest,
|
||||
"HyperTwist.FirstParty.Memory.Phase6R.M6.SerializationRoundTrip",
|
||||
EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter
|
||||
)
|
||||
|
||||
bool FHyperTwistMemoryPhase6RM6SerializationRoundTripTest::RunTest(
|
||||
const FString& Parameters
|
||||
)
|
||||
{
|
||||
const FHyperTwistMemoryDerivedAdjunctState DerivedAdjunctState =
|
||||
UHyperTwistContractLibrary::MakeSampleTrainingMemoryDerivedAdjunctState();
|
||||
TestTrue(
|
||||
TEXT("The Phase 6R-M6 derived-adjunct state must be structurally valid."),
|
||||
DerivedAdjunctState.IsStructurallyValid()
|
||||
);
|
||||
|
||||
const FString Json =
|
||||
UHyperTwistContractLibrary::SerializeMemoryDerivedAdjunctStateToJson(
|
||||
DerivedAdjunctState
|
||||
);
|
||||
TestFalse(TEXT("The serialized M6 JSON must not be empty."), Json.IsEmpty());
|
||||
TestTrue(
|
||||
TEXT("The serialized M6 JSON must expose digest views."),
|
||||
Json.Contains(TEXT("DigestViews"))
|
||||
);
|
||||
|
||||
FHyperTwistMemoryDerivedAdjunctState RoundTrippedState;
|
||||
TestTrue(
|
||||
TEXT("The M6 JSON must deserialize cleanly."),
|
||||
UHyperTwistContractLibrary::DeserializeMemoryDerivedAdjunctStateFromJson(
|
||||
Json,
|
||||
RoundTrippedState
|
||||
)
|
||||
);
|
||||
TestTrue(
|
||||
TEXT("The round-tripped M6 state must remain structurally valid."),
|
||||
RoundTrippedState.IsStructurallyValid()
|
||||
);
|
||||
TestEqual(
|
||||
TEXT("The round-tripped M6 state must preserve compact-summary counts."),
|
||||
RoundTrippedState.CompactSummaryCount,
|
||||
DerivedAdjunctState.CompactSummaryCount
|
||||
);
|
||||
TestEqual(
|
||||
TEXT("The round-tripped M6 state must preserve reduced-context counts."),
|
||||
RoundTrippedState.ReducedContextPacketCount,
|
||||
DerivedAdjunctState.ReducedContextPacketCount
|
||||
);
|
||||
TestEqual(
|
||||
TEXT("The round-tripped M6 state must preserve digest-view counts."),
|
||||
RoundTrippedState.DigestViewCount,
|
||||
DerivedAdjunctState.DigestViewCount
|
||||
);
|
||||
TestEqual(
|
||||
TEXT("The round-tripped M6 state must preserve gate activation."),
|
||||
RoundTrippedState.bDerivedGateActive,
|
||||
DerivedAdjunctState.bDerivedGateActive
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
# HyperTwist Phase 6R-M6 first-party derived memory and optional adjunct implementation packet
|
||||
|
||||
Created on `2026-05-28`
|
||||
|
||||
## Status
|
||||
|
||||
- first-party HyperTwist packet
|
||||
- bounded `Phase 6R-M6` implementation slice
|
||||
|
||||
## Purpose
|
||||
|
||||
This packet lands the bounded first-party derived-memory and optional-adjunct
|
||||
seam under the canonical `Memory Lanes` doctrine.
|
||||
|
||||
The landed slice is:
|
||||
|
||||
- compact summaries
|
||||
- reduced context packets
|
||||
- optional digest views
|
||||
|
||||
It is not:
|
||||
|
||||
- a broad memory federation packet
|
||||
- a replay of `6R-M1`, `6R-M2`, `6R-M3`, `6R-M4`, or `6R-M5`
|
||||
- active user-authored note capture
|
||||
- any derived layer that can become the only stored representation
|
||||
|
||||
## Current authority basis
|
||||
|
||||
This implementation packet stands on:
|
||||
|
||||
- `docs/ops/HYPERTWIST_MEMORY_LANE_AUTHORITY_AND_PHASE_IMPLEMENTATION_DOCTRINE_2026-05-21.md`
|
||||
- `docs/ops/HYPERTWIST_CONTINUITY_LATTICE_AND_CONTEXT_ASSEMBLY_PROFILE_DOCTRINE_2026-05-23.md`
|
||||
- `docs/ops/HYPERTWIST_IMPLEMENTATION_PHASE_1_KICKOFF.md`
|
||||
- `docs/v6_5_deep_manual_pack/HyperTwist/ARCHITECTURE.md`
|
||||
- `docs/v6_5_deep_manual_pack/HyperTwist/FEATURE_REGISTRY.md`
|
||||
- `docs/v6_5_deep_manual_pack/HyperTwist/PROVENANCE_AND_TRUST_MODEL.md`
|
||||
- `docs/arch/HYPERTWIST_PHASE6R_M6_FIRST_PARTY_DERIVED_MEMORY_AND_OPTIONAL_ADJUNCT_PREPARATION_PACKET_2026-05-28.md`
|
||||
|
||||
The preserved owners do not change:
|
||||
|
||||
- first-party HyperTwist remains the top-level owner for current derived-memory
|
||||
compact-view surfaces
|
||||
- the landed `Phase 6R-M1` ledger remains the provenance substrate beneath this
|
||||
packet
|
||||
- the landed `Phase 6R-M2` chronicle/continuity layer remains the current
|
||||
history/open-work substrate beneath this packet
|
||||
- the landed `Phase 6R-M3` recall/shared-context layer remains the current
|
||||
explicit retrieval and scoped-sharing substrate beneath this packet
|
||||
- the landed `Phase 6R-M4` cognitive-consolidation layer remains the current
|
||||
reviewable derived-conclusion substrate beneath this packet
|
||||
- the landed `Phase 6R-M5` knowledge/note-posture layer remains the current
|
||||
curated knowledge substrate beneath this packet
|
||||
- the VectorShell memory doctrine remains the external synchronization
|
||||
entrypoint and authority map, not a frozen imported implementation
|
||||
|
||||
## Landed scope
|
||||
|
||||
The current code now owns a bounded first-party derived-memory and optional
|
||||
adjunct seam through:
|
||||
|
||||
- canonical compact-summary, reduced-context-packet, digest-view, and
|
||||
derived-adjunct state types in:
|
||||
- `HyperTwistMemoryTypes.h`
|
||||
- first-party derived-adjunct derivation from current training repository state
|
||||
over the already-landed `6R-M1`, `6R-M2`, `6R-M3`, `6R-M4`, and `6R-M5`
|
||||
seams plus explicit context-assembly profile choice in:
|
||||
- `UHyperTwistMemoryCoreLibrary`
|
||||
- current bounded active derived coverage for:
|
||||
- memory overview summaries
|
||||
- continuity/resume summaries
|
||||
- knowledge/promotion summaries
|
||||
- coach-resume reduced context packets
|
||||
- knowledge-review reduced context packets
|
||||
- coach-memory digest views
|
||||
- knowledge-memory digest views
|
||||
- current bounded all-features-off correctness through:
|
||||
- `Economic-Retention Mode` returning an empty-but-valid derived-adjunct
|
||||
state with the derived-compacted gate inactive
|
||||
- current bounded derived-only and removability truth through:
|
||||
- explicit `DerivedOnly` lane/authority on every landed `6R-M6` item
|
||||
- explicit removability and all-features-off safety flags on the landed
|
||||
`6R-M6` state
|
||||
- sample contract helpers in:
|
||||
- `UHyperTwistContractLibrary::MakeSampleTrainingMemoryDerivedAdjunctState()`
|
||||
- `UHyperTwistContractLibrary::SerializeMemoryDerivedAdjunctStateToJson(...)`
|
||||
- `UHyperTwistContractLibrary::DeserializeMemoryDerivedAdjunctStateFromJson(...)`
|
||||
- focused automation coverage in:
|
||||
- `HyperTwistMemoryPhase6RM6DerivedAdjunctContractTest.cpp`
|
||||
|
||||
## Why this is still intentionally bounded
|
||||
|
||||
This packet lands derived-only optional adjuncts only.
|
||||
|
||||
Still deferred:
|
||||
|
||||
- active user-authored note capture while ownership remains unjustified
|
||||
- any broader memory federation or rewrite beyond the bounded first-party
|
||||
packet family
|
||||
|
||||
## Validation
|
||||
|
||||
Build validation:
|
||||
|
||||
- `UnrealHyperTwistEditor Win64 Development`
|
||||
|
||||
Focused automation validation:
|
||||
|
||||
- `HyperTwist.FirstParty.Memory.Phase6R.M6.ActiveDerivedViews`
|
||||
- `HyperTwist.FirstParty.Memory.Phase6R.M6.AllFeaturesOffCorrectness`
|
||||
- `HyperTwist.FirstParty.Memory.Phase6R.M6.SerializationRoundTrip`
|
||||
|
||||
Observed:
|
||||
|
||||
- `3` focused `Phase 6R-M6` automation tests succeeded
|
||||
|
||||
Non-blocking warnings stayed limited to the existing Unreal headless/editor
|
||||
noise, expected Python-stub regeneration noise, headless CEF/web-browser
|
||||
warnings, benign asset-registry/cache journal chatter during editor startup,
|
||||
and normal long headless-runtime controller timing warnings during automation.
|
||||
|
||||
## Queue effect
|
||||
|
||||
This packet consumes the current `Phase 6R-M6` implementation slice.
|
||||
|
||||
The bounded first-party memory packet family is now landed through:
|
||||
|
||||
- `6R-M1` contracts and ledger
|
||||
- `6R-M2` chronicle and continuity
|
||||
- `6R-M3` recall and shared context
|
||||
- `6R-M4` cognitive consolidation
|
||||
- `6R-M5` knowledge and notes posture
|
||||
- `6R-M6` derived memory and optional adjunct
|
||||
|
||||
After this landing:
|
||||
|
||||
- do not reopen `6R-M1` through `6R-M6` as broad memory packets
|
||||
- any later memory work must be narrower than the current bounded family
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
# HyperTwist Phase 6R-M6 first-party derived memory and optional adjunct preparation packet
|
||||
|
||||
Created on `2026-05-28`
|
||||
|
||||
## Status
|
||||
|
||||
- first-party HyperTwist packet
|
||||
- source-backed `Phase 6R-M6` preparation/control slice
|
||||
|
||||
## Purpose
|
||||
|
||||
This packet scopes the sixth and final bounded first-party memory implementation
|
||||
slice under the canonical `Memory Lanes` doctrine.
|
||||
|
||||
The granted slice is:
|
||||
|
||||
- compact summaries
|
||||
- reduced context packets
|
||||
- optional digest views
|
||||
|
||||
It is not:
|
||||
|
||||
- a broad memory federation packet
|
||||
- a replay of `6R-M1`, `6R-M2`, `6R-M3`, `6R-M4`, or `6R-M5`
|
||||
- active user-authored note capture
|
||||
- any derived layer that can become the only stored representation
|
||||
|
||||
## Current authority basis
|
||||
|
||||
This control pass stands on:
|
||||
|
||||
- `docs/ops/HYPERTWIST_MEMORY_LANE_AUTHORITY_AND_PHASE_IMPLEMENTATION_DOCTRINE_2026-05-21.md`
|
||||
- `docs/ops/HYPERTWIST_CONTINUITY_LATTICE_AND_CONTEXT_ASSEMBLY_PROFILE_DOCTRINE_2026-05-23.md`
|
||||
- `docs/ops/HYPERTWIST_IMPLEMENTATION_PHASE_1_KICKOFF.md`
|
||||
- `docs/v6_5_deep_manual_pack/HyperTwist/ARCHITECTURE.md`
|
||||
- `docs/v6_5_deep_manual_pack/HyperTwist/FEATURE_REGISTRY.md`
|
||||
- `docs/v6_5_deep_manual_pack/HyperTwist/PROVENANCE_AND_TRUST_MODEL.md`
|
||||
- `docs/arch/HYPERTWIST_PHASE6R_M1_FIRST_PARTY_MEMORY_CONTRACTS_AND_LEDGER_IMPLEMENTATION_PACKET_2026-05-28.md`
|
||||
- `docs/arch/HYPERTWIST_PHASE6R_M2_FIRST_PARTY_CHRONICLE_AND_CONTINUITY_IMPLEMENTATION_PACKET_2026-05-28.md`
|
||||
- `docs/arch/HYPERTWIST_PHASE6R_M3_FIRST_PARTY_RECALL_AND_SHARED_CONTEXT_IMPLEMENTATION_PACKET_2026-05-28.md`
|
||||
- `docs/arch/HYPERTWIST_PHASE6R_M4_FIRST_PARTY_COGNITIVE_CONSOLIDATION_IMPLEMENTATION_PACKET_2026-05-28.md`
|
||||
- `docs/arch/HYPERTWIST_PHASE6R_M5_FIRST_PARTY_KNOWLEDGE_AND_NOTES_IMPLEMENTATION_PACKET_2026-05-28.md`
|
||||
- `docs/VECTORSHELL_MEMORY_SYSTEM_IMPORT_AUTHORITY_FOR_HYPERTWIST_2026-05-25.md`
|
||||
|
||||
The preserved owners do not change here:
|
||||
|
||||
- first-party HyperTwist remains the live owner for current derived-memory
|
||||
compact views
|
||||
- the landed `Phase 6R-M1` ledger remains the provenance substrate beneath this
|
||||
packet
|
||||
- the landed `Phase 6R-M2` chronicle/continuity layer remains the current
|
||||
continuity substrate beneath this packet
|
||||
- the landed `Phase 6R-M3` recall/shared-context layer remains the current
|
||||
retrieval and scoped-sharing substrate beneath this packet
|
||||
- the landed `Phase 6R-M4` cognitive-consolidation layer remains the current
|
||||
derived-conclusion substrate beneath this packet
|
||||
- the landed `Phase 6R-M5` knowledge/note-posture layer remains the current
|
||||
curated knowledge substrate beneath this packet
|
||||
- the VectorShell memory doctrine remains the external synchronization
|
||||
entrypoint and authority map, not a frozen imported implementation
|
||||
|
||||
## Granted family
|
||||
|
||||
The bounded `Phase 6R-M6` slice may land:
|
||||
|
||||
1. compact summaries over current first-party memory evidence
|
||||
2. reduced context packets over already-landed memory seams
|
||||
3. optional digest views over already-landed memory seams
|
||||
4. explicit all-features-off correctness
|
||||
5. explicit derived-only storage and removability truth
|
||||
6. sample contract and JSON round-trip coverage for the `6R-M6` state
|
||||
|
||||
The packet must stay out of:
|
||||
|
||||
- non-derived storage replacement
|
||||
- silent promotion of derived compact views into authoritative truth
|
||||
- active user-authored note capture
|
||||
|
||||
## Proposed implementation shape
|
||||
|
||||
Land the narrower first-party boundary through:
|
||||
|
||||
- new memory types for:
|
||||
- compact summaries
|
||||
- reduced context packets
|
||||
- digest views
|
||||
- bounded derived-adjunct state
|
||||
- a memory-core derivation function over:
|
||||
- the landed `6R-M1` ledger
|
||||
- the landed `6R-M2` chronicle/continuity layer
|
||||
- the landed `6R-M3` recall/shared-context layer
|
||||
- the landed `6R-M4` cognitive-consolidation layer
|
||||
- the landed `6R-M5` knowledge/notes layer
|
||||
- explicit context-assembly profile choice
|
||||
- sample-contract helpers for:
|
||||
- sample derived-adjunct derivation
|
||||
- JSON serialization
|
||||
- JSON deserialization
|
||||
- focused automation in:
|
||||
- `HyperTwistMemoryPhase6RM6DerivedAdjunctContractTest.cpp`
|
||||
|
||||
## Validation target
|
||||
|
||||
Validate with:
|
||||
|
||||
- Unreal build for `UnrealHyperTwistEditor Win64 Development`
|
||||
- focused automation:
|
||||
- `HyperTwist.FirstParty.Memory.Phase6R.M6.ActiveDerivedViews`
|
||||
- `HyperTwist.FirstParty.Memory.Phase6R.M6.AllFeaturesOffCorrectness`
|
||||
- `HyperTwist.FirstParty.Memory.Phase6R.M6.SerializationRoundTrip`
|
||||
|
||||
## Queue effect
|
||||
|
||||
If this packet lands cleanly, the bounded first-party memory packet family is
|
||||
closed through derived-only optional adjuncts.
|
||||
|
||||
After `Phase 6R-M6`:
|
||||
|
||||
- do not reopen `6R-M1` through `6R-M6` as broad memory packets
|
||||
- any later memory work must be a narrower post-`M6` refinement or a separate
|
||||
owner-justification pass
|
||||
|
|
@ -232,8 +232,11 @@ When HyperTwist later returns to memory implementation:
|
|||
landed in current code
|
||||
- the bounded first-party `Phase 6R-M5` knowledge and notes packet is now
|
||||
landed in current code
|
||||
- if memory implementation continues, the next clean move is `Phase 6R-M6`
|
||||
- the bounded first-party `Phase 6R-M6` derived memory and optional adjunct
|
||||
packet is now landed in current code
|
||||
- do not open one broad "memory packet"
|
||||
- the bounded first-party memory packet family is now closed through
|
||||
`Phase 6R-M6`
|
||||
- follow the lane map and packet order in
|
||||
`C:\HyperTwist\docs\ops\HYPERTWIST_MEMORY_LANE_AUTHORITY_AND_PHASE_IMPLEMENTATION_DOCTRINE_2026-05-21.md`
|
||||
|
||||
|
|
|
|||
|
|
@ -670,7 +670,12 @@ Current standing:
|
|||
- current live `6R-M5` surfaces cover curated knowledge objects, reviewable
|
||||
promotion decisions, and explicit user-notes posture/gate truth over the
|
||||
landed `6R-M1`, `6R-M2`, `6R-M3`, and `6R-M4` seams
|
||||
- if memory implementation continues, the next clean move is `6R-M6`
|
||||
- the bounded first-party `Phase 6R-M6` derived memory and optional adjunct
|
||||
packet is now landed in current code
|
||||
- current live `6R-M6` surfaces cover compact summaries, reduced context
|
||||
packets, and optional digest views in explicit derived-only removable form
|
||||
over the landed `6R-M1`, `6R-M2`, `6R-M3`, `6R-M4`, and `6R-M5` seams
|
||||
- the bounded first-party memory packet family is now closed through `6R-M6`
|
||||
|
||||
### `6R-M2` - chronicle and continuity packet
|
||||
|
||||
|
|
@ -724,6 +729,12 @@ This packet must prove:
|
|||
- derived-only storage
|
||||
- removability
|
||||
|
||||
Current standing:
|
||||
|
||||
- the bounded first-party `Phase 6R-M6` packet is now landed
|
||||
- any later memory work must be narrower than the landed `6R-M1` through
|
||||
`6R-M6` packet family
|
||||
|
||||
### Clean-room-later rule
|
||||
|
||||
If a later boundary-sensitive notebook or memory donor becomes the strongest
|
||||
|
|
|
|||
|
|
@ -189,6 +189,8 @@ That means:
|
|||
landed seams
|
||||
- a live first-party `Phase 6R-M5` knowledge-promotion and note-posture layer
|
||||
over those landed seams
|
||||
- a live first-party `Phase 6R-M6` derived-memory and optional-adjunct layer
|
||||
over those landed seams
|
||||
- explicit provenance
|
||||
- explicit custody
|
||||
- two context-assembly profiles:
|
||||
|
|
|
|||
|
|
@ -288,17 +288,17 @@ repo.
|
|||
|---|---|---|---|
|
||||
| Session continuity and workspace recall fragments | Implemented now | first-party runtime/training surfaces | Real substrate fragments under the canonical `Memory Lanes`; not yet a full lane implementation. |
|
||||
| Provenance-aware training/replay/publication state | Implemented now | first-party contract/provenance surfaces | Existing product truth. |
|
||||
| First-party memory contracts and ledger | Implemented now | landed first-party `Phase 6R-M1` packet | Current bounded memory lane ids, entity ids, provenance links, authority flags, feature gates, retention profiles, and ledger JSON round-trip are live. Chronicle/resume, recall/shared context, cognitive extraction, knowledge/notes, and compact reducers stay deferred to later memory packets. |
|
||||
| First-party chronicle and continuity | Implemented now | landed first-party `Phase 6R-M2` packet | Current bounded chronicle events, grouped continuity sessions, resume packs, and repo-aware continuity guards are live above the landed `Phase 6R-M1` ledger seam. Recall/history search, scoped shared-context, cognitive extraction, knowledge/notes, and compact reducers stay deferred to later memory packets. |
|
||||
| First-party recall and shared context | Implemented now | landed first-party `Phase 6R-M3` packet | Current bounded explicit recall matches, history search, provenance drill-down, and revocable shared-context projections are live above the landed `Phase 6R-M1` ledger and `Phase 6R-M2` chronicle/continuity seams. Cognitive extraction, knowledge/notes, and compact reducers stay deferred to later memory packets. |
|
||||
| First-party cognitive consolidation | Implemented now | landed first-party `Phase 6R-M4` packet | Current bounded provenance-backed cognitive facts, contradiction records, supersession links, and confidence-decay entries are live above the landed `Phase 6R-M1`, `Phase 6R-M2`, and `Phase 6R-M3` seams. Knowledge/notes and compact reducers stay deferred to later memory packets. |
|
||||
| First-party knowledge and notes posture | Implemented now | landed first-party `Phase 6R-M5` packet | Current bounded curated knowledge objects, reviewable promotion decisions, and explicit user-notes posture/gating are live above the landed `Phase 6R-M1`, `Phase 6R-M2`, `Phase 6R-M3`, and `Phase 6R-M4` seams. Active user-authored note capture and compact reducers stay deferred to later memory packets. |
|
||||
| First-party memory contracts and ledger | Implemented now | landed first-party `Phase 6R-M1` packet | Current bounded memory lane ids, entity ids, provenance links, authority flags, feature gates, retention profiles, and ledger JSON round-trip are live. Later bounded chronicle/resume, recall/shared-context, cognitive consolidation, knowledge/note posture, and derived-adjunct layers now sit above this seam. |
|
||||
| First-party chronicle and continuity | Implemented now | landed first-party `Phase 6R-M2` packet | Current bounded chronicle events, grouped continuity sessions, resume packs, and repo-aware continuity guards are live above the landed `Phase 6R-M1` ledger seam. Later bounded recall/shared-context, cognitive consolidation, knowledge/note posture, and derived-adjunct layers now sit above this seam. |
|
||||
| First-party recall and shared context | Implemented now | landed first-party `Phase 6R-M3` packet | Current bounded explicit recall matches, history search, provenance drill-down, and revocable shared-context projections are live above the landed `Phase 6R-M1` ledger and `Phase 6R-M2` chronicle/continuity seams. Later bounded cognitive consolidation, knowledge/note posture, and derived-adjunct layers now sit above this seam. |
|
||||
| First-party cognitive consolidation | Implemented now | landed first-party `Phase 6R-M4` packet | Current bounded provenance-backed cognitive facts, contradiction records, supersession links, and confidence-decay entries are live above the landed `Phase 6R-M1`, `Phase 6R-M2`, and `Phase 6R-M3` seams. Later bounded knowledge/note posture and derived-adjunct layers now sit above this seam. |
|
||||
| First-party knowledge and notes posture | Implemented now | landed first-party `Phase 6R-M5` packet | Current bounded curated knowledge objects, reviewable promotion decisions, and explicit user-notes posture/gating are live above the landed `Phase 6R-M1`, `Phase 6R-M2`, `Phase 6R-M3`, and `Phase 6R-M4` seams. Active user-authored note capture still remains deferred, and the landed `Phase 6R-M6` derived-adjunct layer now sits above this seam. |
|
||||
| Control-plane telemetry, replay-diagnostic, and rollout-governance reference grounding | Implemented now | `PostHog/posthog` retained boundary-sensitive lane + first-party current code | Current live `Control-Plane Telemetry and Replay Governance` reference side includes six rewritten first-party contract/reference targets grounded in `PostHog/posthog`: replay diagnostics, replay segmentation, feature governance, scheduled changes, early-access lifecycle, and explicit `MIT`-outside-`ee/` compliance-boundary notes. This does not displace the landed `Phase 4R-D` first-party owner lane, any replay-shell owner family, or the explicit enterprise-subtree exclusion boundary. |
|
||||
| Capture-history, vault, and replay-inspection reference grounding | Implemented now | `screenpipe/screenpipe` retained boundary-sensitive lane + first-party current code | Current live `Capture History, Replay, and Vault Support` reference side includes six rewritten first-party contract/reference targets grounded in `screenpipe/screenpipe`: event-capture, pipe-permission, persistence, vault-lifecycle, timeline-review, and explicit permissive-core-versus-`ee/` compliance-boundary notes. This does not displace the landed `Phase 4R-E` first-party owner lane, the broader replay shell, or the explicit enterprise-subtree exclusion boundary. |
|
||||
| Layered memory federation | Deep-source grounded retained | memory doctrine + VectorShell import entrypoint | Governing taxonomy exists; HyperTwist uses pointer-based synchronization to the current VectorShell memory canon rather than a frozen local fork. Lane widening remains future work and later superior evidence may revise only the exact affected lane or sub-slice. |
|
||||
| Continuity Lattice context assembly | Deep-source grounded retained | continuity-lattice doctrine + VectorShell import entrypoint | One federated substrate with two preset-backed, overrideable profiles: `Max-Retention Mode` and `Economic-Retention Mode`. This is not a second memory system, does not weaken lane authority or optional-assistive override control, and does not justify automatic whole-repo absorption when one continuity sub-slice changes owner. |
|
||||
| User-authored note lane | Deep-source grounded retained | memory doctrine, owner unresolved | Explicit note-lane posture/gating is live through `Phase 6R-M5`, but active user-authored note capture still must not be described as shipped until ownership is justified. |
|
||||
| Compact memory views / reducers | Deep-source grounded retained | optional-assistive + memory doctrine | Must remain derived and optional. Do not copy donor code for any `R3` memory slice; import first-party VectorShell doctrine and code surfaces before bounded donor-derived adjuncts if broader adoption is later justified. |
|
||||
| First-party derived memory and optional adjunct | Implemented now | landed first-party `Phase 6R-M6` packet | Current bounded compact summaries, reduced context packets, and optional digest views are live in explicit derived-only removable form. `Economic-Retention Mode` proves all-features-off correctness by keeping the lane empty and valid, while `Max-Retention Mode` exposes the optional derived adjunct surfaces without promoting them to authoritative truth. |
|
||||
|
||||
### 10. Skills and optional assistive layer
|
||||
|
||||
|
|
|
|||
|
|
@ -103,11 +103,13 @@ and requires provenance to survive:
|
|||
packet
|
||||
- the landed bounded first-party `Phase 6R-M4` cognitive consolidation packet
|
||||
- the landed bounded first-party `Phase 6R-M5` knowledge and notes packet
|
||||
- the landed bounded first-party `Phase 6R-M6` derived memory and optional
|
||||
adjunct packet
|
||||
- chronicle capture
|
||||
- continuity/resume packets
|
||||
- explicit recall and provenance drill-down
|
||||
- derived compact views through the landed `6R-M6` seam
|
||||
- active user-authored note capture beyond the landed `6R-M5` seam
|
||||
- derived compact views
|
||||
|
||||
Important continuity-profile reading:
|
||||
|
||||
|
|
|
|||
|
|
@ -150,9 +150,13 @@ Canonical discovery surfaces for roadmap interpretation:
|
|||
- the generic first-party `Phase 6R-M5` knowledge and notes control pass is now consumed
|
||||
- the bounded first-party `Phase 6R-M5` knowledge and notes packet is now landed in
|
||||
current code
|
||||
- if memory implementation continues, the next clean move is `Phase 6R-M6` derived memory
|
||||
and optional adjunct rather than reopening `6R-M1`, `6R-M2`, `6R-M3`, `6R-M4`, or `6R-M5`
|
||||
as broad memory packets
|
||||
- the generic first-party `Phase 6R-M6` derived memory and optional adjunct control pass is
|
||||
now consumed
|
||||
- the bounded first-party `Phase 6R-M6` derived memory and optional adjunct packet is now
|
||||
landed in current code
|
||||
- do not reopen `6R-M1`, `6R-M2`, `6R-M3`, `6R-M4`, `6R-M5`, or `6R-M6` as broad memory
|
||||
packets
|
||||
- the bounded first-party memory packet family is now closed through `6R-M6`
|
||||
- the generic source-backed `Phase 6R-R` shared classic-cube recognition multi-face
|
||||
correction/explanation control pass is now consumed
|
||||
- the bounded permissive `Phase 6R-R` shared classic-cube recognition multi-face
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue