diff --git a/.gitignore b/.gitignore index 0cc5a6a..d21e770 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,8 @@ website/dist/ website/node_modules/ website/server/node_modules/ website/server/data/ +tools/sentrux/bin/* +!tools/sentrux/bin/.gitkeep # Sensitive or reference-only material. docs/refs/ diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistBootstrap/HyperTwistContractLibrary.cpp b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistBootstrap/HyperTwistContractLibrary.cpp index be115f1..fdbc3b1 100644 --- a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistBootstrap/HyperTwistContractLibrary.cpp +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistBootstrap/HyperTwistContractLibrary.cpp @@ -36,6 +36,117 @@ namespace HyperTwistContractLibraryInternal return FJsonObjectConverter::JsonObjectStringToUStruct(Json, &OutValue, 0, 0); } + FHyperTwistMemoryProvenanceLink MakeSampleMemoryProvenanceLink( + const TCHAR* ParentEntityId, + const EHyperTwistMemoryLane ParentLane, + const TCHAR* ParentRecordKind, + const TCHAR* ParentSourceLabel, + const bool bParentAuthoritative = true + ) + { + FHyperTwistMemoryProvenanceLink ProvenanceLink; + ProvenanceLink.ParentEntityId = ParentEntityId; + ProvenanceLink.ParentLane = ParentLane; + ProvenanceLink.ParentRecordKind = ParentRecordKind; + ProvenanceLink.ParentReferenceUtc = TEXT("2026-04-28T12:40:00Z"); + ProvenanceLink.ParentSourceLabel = ParentSourceLabel; + ProvenanceLink.bParentAuthoritative = bParentAuthoritative; + return ProvenanceLink; + } + + FHyperTwistMemoryLaneContract MakeSampleMemoryLaneContract( + const EHyperTwistMemoryLane Lane, + const TCHAR* LaneId, + const TCHAR* DisplayLabel, + const EHyperTwistMemoryAuthorityKind AuthorityKind, + const TCHAR* DefaultSettingsKey, + const TCHAR* DefaultFeatureGateId, + const bool bCurrentEvidencePresent, + const TCHAR* Summary + ) + { + FHyperTwistMemoryLaneContract LaneContract; + LaneContract.Lane = Lane; + LaneContract.LaneId = LaneId; + LaneContract.DisplayLabel = DisplayLabel; + LaneContract.AuthorityKind = AuthorityKind; + LaneContract.DefaultSettingsKey = DefaultSettingsKey; + LaneContract.DefaultFeatureGateId = DefaultFeatureGateId; + LaneContract.bFirstPartyOwned = true; + LaneContract.bCurrentEvidencePresent = bCurrentEvidencePresent; + LaneContract.Summary = Summary; + return LaneContract; + } + + FHyperTwistMemoryFeatureGate MakeSampleMemoryFeatureGate( + const TCHAR* GateId, + const TCHAR* SettingsKey, + const TCHAR* DisplayLabel, + const EHyperTwistMemoryLane Lane, + const EHyperTwistMemoryFeatureGateDefaultState DefaultState, + const bool bUserControllable, + const bool bDisableAllowed, + const TCHAR* Summary + ) + { + FHyperTwistMemoryFeatureGate FeatureGate; + FeatureGate.GateId = GateId; + FeatureGate.SettingsKey = SettingsKey; + FeatureGate.DisplayLabel = DisplayLabel; + FeatureGate.Lane = Lane; + FeatureGate.DefaultState = DefaultState; + FeatureGate.bUserControllable = bUserControllable; + FeatureGate.bDisableAllowed = bDisableAllowed; + FeatureGate.Summary = Summary; + return FeatureGate; + } + + FHyperTwistMemorySettingsProfile MakeSampleMemorySettingsProfile( + const TCHAR* ProfileId, + const TCHAR* DisplayLabel, + const EHyperTwistMemoryContextAssemblyProfile ContextAssemblyProfile, + TArray EnabledFeatureGateIds, + TArray DisabledFeatureGateIds, + const TCHAR* Summary + ) + { + FHyperTwistMemorySettingsProfile SettingsProfile; + SettingsProfile.ProfileId = ProfileId; + SettingsProfile.DisplayLabel = DisplayLabel; + SettingsProfile.ContextAssemblyProfile = ContextAssemblyProfile; + SettingsProfile.EnabledFeatureGateIds = MoveTemp(EnabledFeatureGateIds); + SettingsProfile.DisabledFeatureGateIds = MoveTemp(DisabledFeatureGateIds); + SettingsProfile.Summary = Summary; + return SettingsProfile; + } + + FHyperTwistMemoryEntityDescriptor MakeSampleMemoryEntityDescriptor( + const TCHAR* EntityId, + const TCHAR* RecordKind, + const TCHAR* DisplayLabel, + const FString& UserId, + const FString& DeckId, + const FString& ReferenceUtc, + const EHyperTwistMemoryLane Lane, + const EHyperTwistMemoryAuthorityKind AuthorityKind, + const bool bDerived, + TArray ProvenanceLinks + ) + { + FHyperTwistMemoryEntityDescriptor EntityDescriptor; + EntityDescriptor.EntityId = EntityId; + EntityDescriptor.RecordKind = RecordKind; + EntityDescriptor.DisplayLabel = DisplayLabel; + EntityDescriptor.UserId = UserId; + EntityDescriptor.DeckId = DeckId; + EntityDescriptor.ReferenceUtc = ReferenceUtc; + EntityDescriptor.Lane = Lane; + EntityDescriptor.AuthorityKind = AuthorityKind; + EntityDescriptor.bDerived = bDerived; + EntityDescriptor.ProvenanceLinks = MoveTemp(ProvenanceLinks); + return EntityDescriptor; + } + FHyperTwistSkillControlProfile MakeSampleSkillControlProfile(const bool bMasterEnabled) { FHyperTwistSkillControlProfile ControlProfile; @@ -516,6 +627,44 @@ namespace HyperTwistContractLibraryInternal return FString(); } + FHyperTwistTrainingCoachActionPlan BuildSampleCoachFollowUpPlan() + { + const FHyperTwistCoachBrief FollowUpBrief = + UHyperTwistContractLibrary::MakeSampleTrainingCoachFollowUpBrief(); + return UHyperTwistTrainingRepositoryLibrary::BuildCoachActionPlan( + FollowUpBrief, + UHyperTwistContractLibrary::MakeSampleTrainingCoachMemorySnapshot(), + TEXT("coach_follow_up_training_session_02"), + TEXT("2026-04-28T12:20:00Z"), + 0, + 0, + FString(), + FollowUpBrief.FocusCaseIds + ); + } + + FHyperTwistTrainingRepositoryState BuildSampleTrainingRepositoryStateWithCoachArtifacts() + { + return AppendSampleCoachArtifacts(UHyperTwistContractLibrary::MakeSampleTrainingRepositoryState()); + } + + FHyperTwistTrainingRepositoryState BuildSampleTrainingRepositoryStateWithCoachFollowUpArtifacts() + { + FHyperTwistTrainingRepositoryState RepositoryState = + BuildSampleTrainingRepositoryStateWithCoachArtifacts(); + const FHyperTwistTrainingCoachActionPlan FollowUpPlan = + BuildSampleCoachFollowUpPlan(); + if (FollowUpPlan.IsStructurallyValid()) + { + RepositoryState = UHyperTwistTrainingRepositoryLibrary::UpsertCoachActionPlan( + RepositoryState, + FollowUpPlan + ); + } + + return RepositoryState; + } + FHyperTwistTrainingRepositoryState BuildSampleTrainingRepositoryStateBase() { const FHyperTwistTrainingRunStepResult StepResult = @@ -4658,91 +4807,1080 @@ FHyperTwistTrainingRepositoryState UHyperTwistContractLibrary::MakeSampleTrainin FHyperTwistMemoryLedgerState UHyperTwistContractLibrary::MakeSampleTrainingMemoryLedgerState() { - FHyperTwistTrainingRepositoryState RepositoryState = MakeSampleTrainingRepositoryState(); - RepositoryState = HyperTwistContractLibraryInternal::AppendSampleCoachArtifacts(RepositoryState); + const FString UserId = TEXT("local-user"); + const FString ReferenceUtc = TEXT("2026-04-28T12:40:00Z"); + const FString DeckId = TEXT("classic-3x3"); - const FString UserId = - HyperTwistContractLibraryInternal::ResolveSampleRepositoryUserId(RepositoryState); + FHyperTwistMemoryLedgerState LedgerState; + LedgerState.UserId = UserId; + LedgerState.ReferenceUtc = ReferenceUtc; + LedgerState.LaneContracts = { + HyperTwistContractLibraryInternal::MakeSampleMemoryLaneContract( + EHyperTwistMemoryLane::IdentityPolicy, + TEXT("memory-lane/identity-policy"), + TEXT("Preferences"), + EHyperTwistMemoryAuthorityKind::Authoritative, + TEXT("memory.identity_policy.enabled"), + TEXT("memory-gate/identity-policy"), + true, + TEXT("First-party trust, consent, and retention policy surfaces.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryLaneContract( + EHyperTwistMemoryLane::WorkspaceRecall, + TEXT("memory-lane/workspace-recall"), + TEXT("Workspace Recall"), + EHyperTwistMemoryAuthorityKind::Authoritative, + TEXT("memory.workspace_recall.enabled"), + TEXT("memory-gate/workspace-recall"), + true, + TEXT("First-party cockpit state, focus anchors, and recent context.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryLaneContract( + EHyperTwistMemoryLane::ChronicleCapture, + TEXT("memory-lane/chronicle-capture"), + TEXT("Training Chronicle"), + EHyperTwistMemoryAuthorityKind::Authoritative, + TEXT("memory.chronicle_capture.enabled"), + TEXT("memory-gate/chronicle-capture"), + true, + TEXT("Append-only training and runtime event evidence.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryLaneContract( + EHyperTwistMemoryLane::ContinuityResume, + TEXT("memory-lane/continuity-resume"), + TEXT("Session Continuity"), + EHyperTwistMemoryAuthorityKind::Authoritative, + TEXT("memory.continuity_resume.enabled"), + TEXT("memory-gate/continuity-resume"), + true, + TEXT("First-party session continuity and resume pointers.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryLaneContract( + EHyperTwistMemoryLane::SharedCoordination, + TEXT("memory-lane/shared-coordination"), + TEXT("Shared Context"), + EHyperTwistMemoryAuthorityKind::SemiAuthoritative, + TEXT("memory.shared_coordination.enabled"), + TEXT("memory-gate/shared-coordination"), + true, + TEXT("Scoped shared context across coach, replay, and sidecar flows.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryLaneContract( + EHyperTwistMemoryLane::RecallRetrieval, + TEXT("memory-lane/recall-retrieval"), + TEXT("Smart Recall"), + EHyperTwistMemoryAuthorityKind::SemiAuthoritative, + TEXT("memory.recall_retrieval.enabled"), + TEXT("memory-gate/recall-retrieval"), + true, + TEXT("Rebuildable retrieval and history-search indexes.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryLaneContract( + EHyperTwistMemoryLane::CognitiveConsolidated, + TEXT("memory-lane/cognitive-consolidated"), + TEXT("Coach Memory"), + EHyperTwistMemoryAuthorityKind::SemiAuthoritative, + TEXT("memory.cognitive_consolidated.enabled"), + TEXT("memory-gate/cognitive-consolidated"), + true, + TEXT("Provenance-backed long-term training state and coach follow-up signals.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryLaneContract( + EHyperTwistMemoryLane::KnowledgeWiki, + TEXT("memory-lane/knowledge-wiki"), + TEXT("Training Atlas"), + EHyperTwistMemoryAuthorityKind::Authoritative, + TEXT("memory.knowledge_wiki.enabled"), + TEXT("memory-gate/knowledge-wiki"), + true, + TEXT("Browsable and reviewable curriculum and knowledge objects.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryLaneContract( + EHyperTwistMemoryLane::UserNotes, + TEXT("memory-lane/user-notes"), + TEXT("Training Notes"), + EHyperTwistMemoryAuthorityKind::Authoritative, + TEXT("memory.user_notes.enabled"), + TEXT("memory-gate/user-notes"), + false, + TEXT("User-authored note content remains separate and explicitly owned.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryLaneContract( + EHyperTwistMemoryLane::ProvenanceLedger, + TEXT("memory-lane/provenance-ledger"), + TEXT("Memory Ledger"), + EHyperTwistMemoryAuthorityKind::Authoritative, + TEXT("memory.provenance_ledger.enabled"), + TEXT("memory-gate/provenance-ledger"), + true, + TEXT("Lineage and trust ledger for every non-raw memory surface.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryLaneContract( + EHyperTwistMemoryLane::DerivedCompacted, + TEXT("memory-lane/derived-compacted"), + TEXT("Compact Views"), + EHyperTwistMemoryAuthorityKind::DerivedOnly, + TEXT("memory.derived_compacted.enabled"), + TEXT("memory-gate/derived-compacted"), + true, + TEXT("Discardable compact summaries and reduced context packets.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryLaneContract( + EHyperTwistMemoryLane::ProceduralWorkflow, + TEXT("memory-lane/procedural-workflow"), + TEXT("Workflow Memory"), + EHyperTwistMemoryAuthorityKind::Authoritative, + TEXT("memory.procedural_workflow.enabled"), + TEXT("memory-gate/procedural-workflow"), + true, + TEXT("Durable templates, drill workflows, queues, and follow-up routines.") + ) + }; + LedgerState.FeatureGates = { + HyperTwistContractLibraryInternal::MakeSampleMemoryFeatureGate( + TEXT("memory-gate/identity-policy"), + TEXT("memory.identity_policy.enabled"), + TEXT("Identity Policy"), + EHyperTwistMemoryLane::IdentityPolicy, + EHyperTwistMemoryFeatureGateDefaultState::RequiredEnabled, + false, + false, + TEXT("Keep consent, retention, and provider policy first-party owned.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryFeatureGate( + TEXT("memory-gate/workspace-recall"), + TEXT("memory.workspace_recall.enabled"), + TEXT("Workspace Recall"), + EHyperTwistMemoryLane::WorkspaceRecall, + EHyperTwistMemoryFeatureGateDefaultState::RequiredEnabled, + false, + false, + TEXT("Preserve cockpit state and focus anchors as first-party authority.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryFeatureGate( + TEXT("memory-gate/chronicle-capture"), + TEXT("memory.chronicle_capture.enabled"), + TEXT("Chronicle Capture"), + EHyperTwistMemoryLane::ChronicleCapture, + EHyperTwistMemoryFeatureGateDefaultState::RequiredEnabled, + false, + false, + TEXT("Keep append-only chronicle evidence active for later provenance.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryFeatureGate( + TEXT("memory-gate/continuity-resume"), + TEXT("memory.continuity_resume.enabled"), + TEXT("Continuity Resume"), + EHyperTwistMemoryLane::ContinuityResume, + EHyperTwistMemoryFeatureGateDefaultState::RequiredEnabled, + false, + false, + TEXT("Keep resume pointers and active continuity fragments available.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryFeatureGate( + TEXT("memory-gate/shared-coordination"), + TEXT("memory.shared_coordination.enabled"), + TEXT("Shared Coordination"), + EHyperTwistMemoryLane::SharedCoordination, + EHyperTwistMemoryFeatureGateDefaultState::EnabledByDefault, + true, + true, + TEXT("Allow revocable shared context without promoting it to durable cognition.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryFeatureGate( + TEXT("memory-gate/recall-retrieval"), + TEXT("memory.recall_retrieval.enabled"), + TEXT("Recall Retrieval"), + EHyperTwistMemoryLane::RecallRetrieval, + EHyperTwistMemoryFeatureGateDefaultState::EnabledByDefault, + true, + true, + TEXT("Permit rebuildable history search and retrieval indexes.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryFeatureGate( + TEXT("memory-gate/cognitive-consolidated"), + TEXT("memory.cognitive_consolidated.enabled"), + TEXT("Cognitive Consolidated"), + EHyperTwistMemoryLane::CognitiveConsolidated, + EHyperTwistMemoryFeatureGateDefaultState::EnabledByDefault, + true, + true, + TEXT("Expose provenance-backed coach-memory and follow-up consolidation.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryFeatureGate( + TEXT("memory-gate/knowledge-wiki"), + TEXT("memory.knowledge_wiki.enabled"), + TEXT("Knowledge Wiki"), + EHyperTwistMemoryLane::KnowledgeWiki, + EHyperTwistMemoryFeatureGateDefaultState::EnabledByDefault, + true, + true, + TEXT("Keep curated knowledge available without promoting raw chronicle data.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryFeatureGate( + TEXT("memory-gate/user-notes"), + TEXT("memory.user_notes.enabled"), + TEXT("User Notes"), + EHyperTwistMemoryLane::UserNotes, + EHyperTwistMemoryFeatureGateDefaultState::DisabledByDefault, + true, + true, + TEXT("Do not auto-enable note capture until explicit user ownership is active.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryFeatureGate( + TEXT("memory-gate/provenance-ledger"), + TEXT("memory.provenance_ledger.enabled"), + TEXT("Provenance Ledger"), + EHyperTwistMemoryLane::ProvenanceLedger, + EHyperTwistMemoryFeatureGateDefaultState::RequiredEnabled, + false, + false, + TEXT("Require lineage preservation for every non-raw memory surface.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryFeatureGate( + TEXT("memory-gate/derived-compacted"), + TEXT("memory.derived_compacted.enabled"), + TEXT("Derived Compacted"), + EHyperTwistMemoryLane::DerivedCompacted, + EHyperTwistMemoryFeatureGateDefaultState::EnabledByDefault, + true, + true, + TEXT("Allow discardable compact views and reduced context packets.") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryFeatureGate( + TEXT("memory-gate/procedural-workflow"), + TEXT("memory.procedural_workflow.enabled"), + TEXT("Procedural Workflow"), + EHyperTwistMemoryLane::ProceduralWorkflow, + EHyperTwistMemoryFeatureGateDefaultState::RequiredEnabled, + false, + false, + TEXT("Keep templates, queues, and follow-up workflows first-party owned.") + ) + }; + LedgerState.EconomicRetentionProfile = + HyperTwistContractLibraryInternal::MakeSampleMemorySettingsProfile( + TEXT("memory-profile/economic-retention"), + TEXT("Economic-Retention Mode"), + EHyperTwistMemoryContextAssemblyProfile::EconomicRetentionMode, + { + TEXT("memory-gate/identity-policy"), + TEXT("memory-gate/workspace-recall"), + TEXT("memory-gate/chronicle-capture"), + TEXT("memory-gate/continuity-resume"), + TEXT("memory-gate/knowledge-wiki"), + TEXT("memory-gate/provenance-ledger"), + TEXT("memory-gate/procedural-workflow") + }, + { + TEXT("memory-gate/shared-coordination"), + TEXT("memory-gate/recall-retrieval"), + TEXT("memory-gate/cognitive-consolidated"), + TEXT("memory-gate/user-notes"), + TEXT("memory-gate/derived-compacted") + }, + TEXT("Minimum active memory posture while preserving first-party contracts and provenance.") + ); + LedgerState.MaxRetentionProfile = + HyperTwistContractLibraryInternal::MakeSampleMemorySettingsProfile( + TEXT("memory-profile/max-retention"), + TEXT("Max-Retention Mode"), + EHyperTwistMemoryContextAssemblyProfile::MaxRetentionMode, + { + TEXT("memory-gate/identity-policy"), + TEXT("memory-gate/workspace-recall"), + TEXT("memory-gate/chronicle-capture"), + TEXT("memory-gate/continuity-resume"), + TEXT("memory-gate/shared-coordination"), + TEXT("memory-gate/recall-retrieval"), + TEXT("memory-gate/cognitive-consolidated"), + TEXT("memory-gate/knowledge-wiki"), + TEXT("memory-gate/provenance-ledger"), + TEXT("memory-gate/derived-compacted"), + TEXT("memory-gate/procedural-workflow") + }, + { + TEXT("memory-gate/user-notes") + }, + TEXT("High-retention posture for broader context assembly before uncertainty becomes dangerous.") + ); + LedgerState.Entities = { + HyperTwistContractLibraryInternal::MakeSampleMemoryEntityDescriptor( + TEXT("memory-entity/policy/local-user"), + TEXT("identity-policy-profile"), + TEXT("Local User Memory Policy"), + UserId, + DeckId, + ReferenceUtc, + EHyperTwistMemoryLane::IdentityPolicy, + EHyperTwistMemoryAuthorityKind::Authoritative, + false, + {} + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryEntityDescriptor( + TEXT("memory-entity/provenance/ledger-contracts"), + TEXT("memory-ledger-contract"), + TEXT("Memory Ledger Contracts"), + UserId, + DeckId, + ReferenceUtc, + EHyperTwistMemoryLane::ProvenanceLedger, + EHyperTwistMemoryAuthorityKind::Authoritative, + false, + {} + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryEntityDescriptor( + TEXT("memory-entity/chronicle/run-record-001"), + TEXT("training-run-record"), + TEXT("Training Run Record"), + UserId, + DeckId, + ReferenceUtc, + EHyperTwistMemoryLane::ChronicleCapture, + EHyperTwistMemoryAuthorityKind::Authoritative, + false, + {} + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryEntityDescriptor( + TEXT("memory-entity/workflow/review-plan-001"), + TEXT("training-review-plan"), + TEXT("Review Plan"), + UserId, + DeckId, + TEXT("2026-04-28T12:20:00Z"), + EHyperTwistMemoryLane::ProceduralWorkflow, + EHyperTwistMemoryAuthorityKind::Authoritative, + false, + {} + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryEntityDescriptor( + TEXT("memory-entity/workflow/session-template-001"), + TEXT("training-session-template"), + TEXT("Session Template"), + UserId, + DeckId, + TEXT("2026-04-28T12:08:00Z"), + EHyperTwistMemoryLane::ProceduralWorkflow, + EHyperTwistMemoryAuthorityKind::Authoritative, + false, + {} + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryEntityDescriptor( + TEXT("memory-entity/workflow/method-drill-favorite-001"), + TEXT("method-drill-favorite"), + TEXT("Favorite OLL Drill"), + UserId, + DeckId, + TEXT("2026-04-28T12:11:00Z"), + EHyperTwistMemoryLane::ProceduralWorkflow, + EHyperTwistMemoryAuthorityKind::Authoritative, + false, + {} + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryEntityDescriptor( + TEXT("memory-entity/workflow/method-drill-batch-001"), + TEXT("method-drill-batch"), + TEXT("PLL Reinforcement Batch"), + UserId, + DeckId, + TEXT("2026-04-28T12:12:30Z"), + EHyperTwistMemoryLane::ProceduralWorkflow, + EHyperTwistMemoryAuthorityKind::Authoritative, + false, + {} + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryEntityDescriptor( + TEXT("memory-entity/workflow/coach-action-plan-001"), + TEXT("coach-action-plan"), + TEXT("Coach Action Plan"), + UserId, + DeckId, + TEXT("2026-04-28T12:22:00Z"), + EHyperTwistMemoryLane::ProceduralWorkflow, + EHyperTwistMemoryAuthorityKind::Authoritative, + false, + {} + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryEntityDescriptor( + TEXT("memory-entity/workflow/coach-queue-001"), + TEXT("coach-session-queue"), + TEXT("Coach Session Queue"), + UserId, + DeckId, + TEXT("2026-04-28T12:25:00Z"), + EHyperTwistMemoryLane::ProceduralWorkflow, + EHyperTwistMemoryAuthorityKind::Authoritative, + false, + {} + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryEntityDescriptor( + TEXT("memory-entity/cognitive/case-learner-state-001"), + TEXT("case-learner-state"), + TEXT("Learner State For Case OLL-57"), + UserId, + DeckId, + TEXT("2026-04-28T12:30:00Z"), + EHyperTwistMemoryLane::CognitiveConsolidated, + EHyperTwistMemoryAuthorityKind::SemiAuthoritative, + true, + { + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/chronicle/run-record-001"), + EHyperTwistMemoryLane::ChronicleCapture, + TEXT("training-run-record"), + TEXT("chronicle-fixture") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/workflow/review-plan-001"), + EHyperTwistMemoryLane::ProceduralWorkflow, + TEXT("training-review-plan"), + TEXT("review-plan-fixture") + ) + } + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryEntityDescriptor( + TEXT("memory-entity/recall/review-program-summary-001"), + TEXT("review-program-summary"), + TEXT("Review Program Summary"), + UserId, + DeckId, + TEXT("2026-04-28T12:31:00Z"), + EHyperTwistMemoryLane::RecallRetrieval, + EHyperTwistMemoryAuthorityKind::SemiAuthoritative, + true, + { + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/workflow/review-plan-001"), + EHyperTwistMemoryLane::ProceduralWorkflow, + TEXT("training-review-plan"), + TEXT("review-plan-fixture") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/chronicle/run-record-001"), + EHyperTwistMemoryLane::ChronicleCapture, + TEXT("training-run-record"), + TEXT("chronicle-fixture") + ) + } + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryEntityDescriptor( + TEXT("memory-entity/shared/coach-queue-execution-001"), + TEXT("coach-queue-execution"), + TEXT("Coach Queue Execution Context"), + UserId, + DeckId, + TEXT("2026-04-28T12:33:00Z"), + EHyperTwistMemoryLane::SharedCoordination, + EHyperTwistMemoryAuthorityKind::SemiAuthoritative, + true, + { + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/workflow/coach-queue-001"), + EHyperTwistMemoryLane::ProceduralWorkflow, + TEXT("coach-session-queue"), + TEXT("queue-fixture") + ) + } + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryEntityDescriptor( + TEXT("memory-entity/derived/learner-profile-summary-001"), + TEXT("learner-profile-summary"), + TEXT("Learner Profile Summary"), + UserId, + DeckId, + TEXT("2026-04-28T12:35:00Z"), + EHyperTwistMemoryLane::DerivedCompacted, + EHyperTwistMemoryAuthorityKind::DerivedOnly, + true, + { + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/cognitive/case-learner-state-001"), + EHyperTwistMemoryLane::CognitiveConsolidated, + TEXT("case-learner-state"), + TEXT("cognitive-fixture"), + false + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/recall/review-program-summary-001"), + EHyperTwistMemoryLane::RecallRetrieval, + TEXT("review-program-summary"), + TEXT("recall-fixture"), + false + ) + } + ) + }; - if (UserId.IsEmpty()) + for (const FHyperTwistMemoryEntityDescriptor& Entity : LedgerState.Entities) { - return FHyperTwistMemoryLedgerState(); + switch (Entity.AuthorityKind) + { + case EHyperTwistMemoryAuthorityKind::Authoritative: + ++LedgerState.AuthoritativeEntityCount; + break; + case EHyperTwistMemoryAuthorityKind::SemiAuthoritative: + ++LedgerState.SemiAuthoritativeEntityCount; + break; + case EHyperTwistMemoryAuthorityKind::DerivedOnly: + ++LedgerState.DerivedEntityCount; + break; + default: + break; + } } - return UHyperTwistMemoryCoreLibrary::DeriveMemoryLedgerState( - RepositoryState, - UserId, - TEXT("2026-04-28T12:40:00Z") - ); + return LedgerState; } FHyperTwistMemoryChronicleContinuityState UHyperTwistContractLibrary::MakeSampleTrainingMemoryChronicleContinuityState() { - FHyperTwistTrainingRepositoryState RepositoryState = MakeSampleTrainingRepositoryState(); - RepositoryState = HyperTwistContractLibraryInternal::AppendSampleCoachArtifacts(RepositoryState); + const FString UserId = TEXT("local-user"); + const FString ReferenceUtc = TEXT("2026-04-28T12:40:00Z"); + const FString DeckId = TEXT("classic-3x3"); - const FString UserId = - HyperTwistContractLibraryInternal::ResolveSampleRepositoryUserId(RepositoryState); - if (UserId.IsEmpty()) - { - return FHyperTwistMemoryChronicleContinuityState(); - } - - return UHyperTwistMemoryCoreLibrary::DeriveMemoryChronicleContinuityState( - RepositoryState, - UserId, - TEXT("2026-04-28T12:40:00Z") - ); + FHyperTwistMemoryChronicleContinuityState ChronicleContinuityState; + ChronicleContinuityState.UserId = UserId; + ChronicleContinuityState.ReferenceUtc = ReferenceUtc; + ChronicleContinuityState.ChronicleEvents = { + [&]() + { + FHyperTwistMemoryChronicleEventEntry ChronicleEvent; + ChronicleEvent.EventId = TEXT("memory-chronicle-event/run-record-001"); + ChronicleEvent.EventKind = TEXT("training-run-record"); + ChronicleEvent.DisplayLabel = TEXT("Training Run Record"); + ChronicleEvent.UserId = UserId; + ChronicleEvent.DeckId = DeckId; + ChronicleEvent.RootRecordId = TEXT("run-record-001"); + ChronicleEvent.RelatedTrainingSessionId = TEXT("training-session-001"); + ChronicleEvent.RecordedAtUtc = ReferenceUtc; + ChronicleEvent.Lane = EHyperTwistMemoryLane::ChronicleCapture; + ChronicleEvent.bOpenContinuity = true; + ChronicleEvent.ProvenanceLinks = { + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/chronicle/run-record-001"), + EHyperTwistMemoryLane::ChronicleCapture, + TEXT("training-run-record"), + TEXT("chronicle-fixture") + ) + }; + return ChronicleEvent; + }(), + [&]() + { + FHyperTwistMemoryChronicleEventEntry ChronicleEvent; + ChronicleEvent.EventId = TEXT("memory-chronicle-event/session-template-001"); + ChronicleEvent.EventKind = TEXT("training-session-template"); + ChronicleEvent.DisplayLabel = TEXT("Stored Session Template"); + ChronicleEvent.UserId = UserId; + ChronicleEvent.DeckId = DeckId; + ChronicleEvent.RootRecordId = TEXT("session-template-001"); + ChronicleEvent.RelatedTrainingSessionId = TEXT("training-session-001"); + ChronicleEvent.RecordedAtUtc = TEXT("2026-04-28T12:08:00Z"); + ChronicleEvent.Lane = EHyperTwistMemoryLane::ChronicleCapture; + ChronicleEvent.bOpenContinuity = false; + ChronicleEvent.ProvenanceLinks = { + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/workflow/session-template-001"), + EHyperTwistMemoryLane::ProceduralWorkflow, + TEXT("training-session-template"), + TEXT("workflow-fixture") + ) + }; + return ChronicleEvent; + }(), + [&]() + { + FHyperTwistMemoryChronicleEventEntry ChronicleEvent; + ChronicleEvent.EventId = TEXT("memory-chronicle-event/review-plan-001"); + ChronicleEvent.EventKind = TEXT("review-plan"); + ChronicleEvent.DisplayLabel = TEXT("Review Plan Continuity"); + ChronicleEvent.UserId = UserId; + ChronicleEvent.DeckId = DeckId; + ChronicleEvent.RootRecordId = TEXT("review-plan-001"); + ChronicleEvent.RelatedTrainingSessionId = TEXT("training-session-001"); + ChronicleEvent.RelatedReviewPlanId = TEXT("review-plan-001"); + ChronicleEvent.RecordedAtUtc = TEXT("2026-04-28T12:20:00Z"); + ChronicleEvent.Lane = EHyperTwistMemoryLane::ContinuityResume; + ChronicleEvent.bOpenContinuity = true; + ChronicleEvent.ProvenanceLinks = { + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/workflow/review-plan-001"), + EHyperTwistMemoryLane::ProceduralWorkflow, + TEXT("training-review-plan"), + TEXT("review-plan-fixture") + ) + }; + return ChronicleEvent; + }(), + [&]() + { + FHyperTwistMemoryChronicleEventEntry ChronicleEvent; + ChronicleEvent.EventId = TEXT("memory-chronicle-event/coach-queue-001"); + ChronicleEvent.EventKind = TEXT("coach-session-queue"); + ChronicleEvent.DisplayLabel = TEXT("Coach Session Queue Continuity"); + ChronicleEvent.UserId = UserId; + ChronicleEvent.DeckId = DeckId; + ChronicleEvent.RootRecordId = TEXT("coach-queue-001"); + ChronicleEvent.RelatedTrainingSessionId = TEXT("training-session-001"); + ChronicleEvent.RelatedQueueId = TEXT("coach-queue-001"); + ChronicleEvent.RecordedAtUtc = TEXT("2026-04-28T12:25:00Z"); + ChronicleEvent.Lane = EHyperTwistMemoryLane::ContinuityResume; + ChronicleEvent.bOpenContinuity = true; + ChronicleEvent.ProvenanceLinks = { + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/workflow/coach-queue-001"), + EHyperTwistMemoryLane::ProceduralWorkflow, + TEXT("coach-session-queue"), + TEXT("queue-fixture") + ) + }; + return ChronicleEvent; + }() + }; + ChronicleContinuityState.SessionGroups = { + [&]() + { + FHyperTwistMemorySessionGroup SessionGroup; + SessionGroup.GroupId = TEXT("memory-session-group/training-session-001"); + SessionGroup.GroupKind = TEXT("training-session"); + SessionGroup.Headline = TEXT("Pinned recovery review"); + SessionGroup.UserId = UserId; + SessionGroup.DeckId = DeckId; + SessionGroup.RootRecordId = TEXT("run-record-001"); + SessionGroup.RootTrainingSessionId = TEXT("training-session-001"); + SessionGroup.ReferenceUtc = ReferenceUtc; + SessionGroup.ChronicleEventIds = { + TEXT("memory-chronicle-event/run-record-001"), + TEXT("memory-chronicle-event/session-template-001") + }; + SessionGroup.FocusCaseIds = { TEXT("case-oll-57"), TEXT("case-pll-21") }; + SessionGroup.EventCount = SessionGroup.ChronicleEventIds.Num(); + SessionGroup.bCompleted = true; + SessionGroup.bHasResumeCandidate = false; + SessionGroup.bRequiresContinuityGuard = false; + SessionGroup.ProvenanceLinks = { + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/chronicle/run-record-001"), + EHyperTwistMemoryLane::ChronicleCapture, + TEXT("training-run-record"), + TEXT("chronicle-fixture") + ) + }; + return SessionGroup; + }(), + [&]() + { + FHyperTwistMemorySessionGroup SessionGroup; + SessionGroup.GroupId = TEXT("memory-session-group/review-plan-001"); + SessionGroup.GroupKind = TEXT("review-plan"); + SessionGroup.Headline = TEXT("Review plan waiting for resume"); + SessionGroup.UserId = UserId; + SessionGroup.DeckId = DeckId; + SessionGroup.RootRecordId = TEXT("review-plan-001"); + SessionGroup.RootTrainingSessionId = TEXT("training-session-001"); + SessionGroup.RootReviewPlanId = TEXT("review-plan-001"); + SessionGroup.ReferenceUtc = ReferenceUtc; + SessionGroup.ChronicleEventIds = { TEXT("memory-chronicle-event/review-plan-001") }; + SessionGroup.FocusCaseIds = { TEXT("case-oll-57") }; + SessionGroup.EventCount = SessionGroup.ChronicleEventIds.Num(); + SessionGroup.bCompleted = false; + SessionGroup.bHasResumeCandidate = true; + SessionGroup.bRequiresContinuityGuard = false; + SessionGroup.ProvenanceLinks = { + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/workflow/review-plan-001"), + EHyperTwistMemoryLane::ProceduralWorkflow, + TEXT("training-review-plan"), + TEXT("review-plan-fixture") + ) + }; + return SessionGroup; + }(), + [&]() + { + FHyperTwistMemorySessionGroup SessionGroup; + SessionGroup.GroupId = TEXT("memory-session-group/coach-queue-001"); + SessionGroup.GroupKind = TEXT("coach-session-queue"); + SessionGroup.Headline = TEXT("Coach queue follow-up still pending"); + SessionGroup.UserId = UserId; + SessionGroup.DeckId = DeckId; + SessionGroup.RootRecordId = TEXT("coach-queue-001"); + SessionGroup.RootTrainingSessionId = TEXT("training-session-001"); + SessionGroup.RootQueueId = TEXT("coach-queue-001"); + SessionGroup.ReferenceUtc = ReferenceUtc; + SessionGroup.ChronicleEventIds = { TEXT("memory-chronicle-event/coach-queue-001") }; + SessionGroup.FocusCaseIds = { TEXT("case-pll-21") }; + SessionGroup.EventCount = SessionGroup.ChronicleEventIds.Num(); + SessionGroup.bCompleted = false; + SessionGroup.bHasResumeCandidate = true; + SessionGroup.bRequiresContinuityGuard = false; + SessionGroup.ProvenanceLinks = { + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/workflow/coach-queue-001"), + EHyperTwistMemoryLane::ProceduralWorkflow, + TEXT("coach-session-queue"), + TEXT("queue-fixture") + ) + }; + return SessionGroup; + }() + }; + ChronicleContinuityState.ResumePacks = { + [&]() + { + FHyperTwistMemoryResumePack ResumePack; + ResumePack.PackId = TEXT("memory-resume-pack/review-plan-001"); + ResumePack.PackKind = TEXT("review-plan-resume"); + ResumePack.Headline = TEXT("Resume bounded review plan"); + ResumePack.UserId = UserId; + ResumePack.DeckId = DeckId; + ResumePack.ResumeTargetId = TEXT("review-plan-001"); + ResumePack.ResumeActionId = TEXT("resume-review-plan"); + ResumePack.ReferenceUtc = ReferenceUtc; + ResumePack.Lane = EHyperTwistMemoryLane::ContinuityResume; + ResumePack.ChronicleGroupIds = { TEXT("memory-session-group/review-plan-001") }; + ResumePack.FocusCaseIds = { TEXT("case-oll-57") }; + ResumePack.PendingItemCount = 1; + ResumePack.bNeedsContinuityGuard = false; + ResumePack.bTimeSensitive = false; + ResumePack.ProvenanceLinks = { + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/workflow/review-plan-001"), + EHyperTwistMemoryLane::ProceduralWorkflow, + TEXT("training-review-plan"), + TEXT("review-plan-fixture") + ) + }; + return ResumePack; + }(), + [&]() + { + FHyperTwistMemoryResumePack ResumePack; + ResumePack.PackId = TEXT("memory-resume-pack/coach-queue-001"); + ResumePack.PackKind = TEXT("coach-session-queue-resume"); + ResumePack.Headline = TEXT("Resume coach follow-up queue"); + ResumePack.UserId = UserId; + ResumePack.DeckId = DeckId; + ResumePack.ResumeTargetId = TEXT("coach-queue-001"); + ResumePack.ResumeActionId = TEXT("resume-coach-queue"); + ResumePack.ReferenceUtc = ReferenceUtc; + ResumePack.Lane = EHyperTwistMemoryLane::ContinuityResume; + ResumePack.ChronicleGroupIds = { TEXT("memory-session-group/coach-queue-001") }; + ResumePack.FocusCaseIds = { TEXT("case-pll-21") }; + ResumePack.PendingItemCount = 2; + ResumePack.bNeedsContinuityGuard = false; + ResumePack.bTimeSensitive = true; + ResumePack.ProvenanceLinks = { + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/workflow/coach-queue-001"), + EHyperTwistMemoryLane::ProceduralWorkflow, + TEXT("coach-session-queue"), + TEXT("queue-fixture") + ) + }; + return ResumePack; + }() + }; + ChronicleContinuityState.ChronicleCaptureEventCount = 2; + ChronicleContinuityState.ContinuityResumeEventCount = 2; + ChronicleContinuityState.OpenSessionGroupCount = 2; + ChronicleContinuityState.ResumeRequiredCount = ChronicleContinuityState.ResumePacks.Num(); + ChronicleContinuityState.BlockingGuardCount = 0; + ChronicleContinuityState.bHasRepositoryContinuityIssues = false; + return ChronicleContinuityState; } FHyperTwistMemoryRecallSharedContextState UHyperTwistContractLibrary::MakeSampleTrainingMemoryRecallSharedContextState() { - FHyperTwistTrainingRepositoryState RepositoryState = MakeSampleTrainingRepositoryState(); - RepositoryState = HyperTwistContractLibraryInternal::AppendSampleCoachArtifacts(RepositoryState); + const FString UserId = TEXT("local-user"); + const FString ReferenceUtc = TEXT("2026-04-28T12:40:00Z"); + const auto ReviewProgramProvenance = + TArray{ + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/recall/review-program-summary/local-user"), + EHyperTwistMemoryLane::RecallRetrieval, + TEXT("review-program-summary"), + TEXT("review-program-fixture") + ) + }; + const auto TemplateProvenance = + TArray{ + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/workflow/session-template-001"), + EHyperTwistMemoryLane::ProceduralWorkflow, + TEXT("training-session-template"), + TEXT("workflow-fixture") + ) + }; + const auto CoachMemoryProvenance = + TArray{ + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/cognitive/coach-memory-summary/local-user"), + EHyperTwistMemoryLane::CognitiveConsolidated, + TEXT("coach-memory-summary"), + TEXT("coach-memory-fixture"), + false + ) + }; + const auto SidecarProvenance = + TArray{ + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/shared/sidecar-brief/local-user"), + EHyperTwistMemoryLane::SharedCoordination, + TEXT("sidecar-brief"), + TEXT("sidecar-fixture"), + false + ) + }; - const FString UserId = - HyperTwistContractLibraryInternal::ResolveSampleRepositoryUserId(RepositoryState); - if (UserId.IsEmpty()) - { - return FHyperTwistMemoryRecallSharedContextState(); - } - - return UHyperTwistMemoryCoreLibrary::DeriveMemoryRecallSharedContextState( - RepositoryState, - UserId, - TEXT("2026-04-28T12:40:00Z"), - TEXT("resume review coach history") - ); + FHyperTwistMemoryRecallSharedContextState RecallState; + RecallState.UserId = UserId; + RecallState.ReferenceUtc = ReferenceUtc; + RecallState.QueryText = TEXT("resume review coach history"); + RecallState.QueryTokens = { TEXT("resume"), TEXT("review"), TEXT("coach"), TEXT("history") }; + RecallState.RecallMatches = { + [&]() + { + FHyperTwistMemoryRecallMatch RecallMatch; + RecallMatch.MatchId = TEXT("memory-recall-match/review-program"); + RecallMatch.MatchKind = TEXT("remember-focus"); + RecallMatch.Headline = TEXT("Review program still has active follow-up pressure"); + RecallMatch.UserId = UserId; + RecallMatch.DeckId = TEXT("classic-3x3"); + RecallMatch.SourceEntityId = + TEXT("memory-entity/recall/review-program-summary/local-user"); + RecallMatch.SourceRecordKind = TEXT("review-program-summary"); + RecallMatch.SourceRecordId = TEXT("review-program-summary-001"); + RecallMatch.ReferenceUtc = ReferenceUtc; + RecallMatch.Lane = EHyperTwistMemoryLane::RecallRetrieval; + RecallMatch.AuthorityKind = EHyperTwistMemoryAuthorityKind::Authoritative; + RecallMatch.MatchScore = 96; + RecallMatch.MatchReasonLines = { + TEXT("Matches the explicit resume query."), + TEXT("Preserves authoritative program pressure.") + }; + RecallMatch.ProvenanceLinks = ReviewProgramProvenance; + return RecallMatch; + }(), + [&]() + { + FHyperTwistMemoryRecallMatch RecallMatch; + RecallMatch.MatchId = TEXT("memory-recall-match/session-template"); + RecallMatch.MatchKind = TEXT("template-anchor"); + RecallMatch.Headline = TEXT("Pinned recovery review template remains relevant"); + RecallMatch.UserId = UserId; + RecallMatch.DeckId = TEXT("classic-3x3"); + RecallMatch.SourceEntityId = TEXT("memory-entity/workflow/session-template-001"); + RecallMatch.SourceRecordKind = TEXT("training-session-template"); + RecallMatch.SourceRecordId = TEXT("session-template-001"); + RecallMatch.ReferenceUtc = ReferenceUtc; + RecallMatch.Lane = EHyperTwistMemoryLane::RecallRetrieval; + RecallMatch.AuthorityKind = EHyperTwistMemoryAuthorityKind::Authoritative; + RecallMatch.MatchScore = 88; + RecallMatch.MatchReasonLines = { + TEXT("Template was previously pinned by the learner."), + TEXT("Template remains directly reusable.") + }; + RecallMatch.ProvenanceLinks = TemplateProvenance; + return RecallMatch; + }(), + [&]() + { + FHyperTwistMemoryRecallMatch RecallMatch; + RecallMatch.MatchId = TEXT("memory-recall-match/coach-memory"); + RecallMatch.MatchKind = TEXT("coach-pressure"); + RecallMatch.Headline = TEXT("Coach memory still marks unresolved follow-up"); + RecallMatch.UserId = UserId; + RecallMatch.DeckId = TEXT("classic-3x3"); + RecallMatch.SourceEntityId = + TEXT("memory-entity/cognitive/coach-memory-summary/local-user"); + RecallMatch.SourceRecordKind = TEXT("coach-memory-summary"); + RecallMatch.SourceRecordId = TEXT("coach-memory-summary-001"); + RecallMatch.ReferenceUtc = ReferenceUtc; + RecallMatch.Lane = EHyperTwistMemoryLane::RecallRetrieval; + RecallMatch.AuthorityKind = EHyperTwistMemoryAuthorityKind::SemiAuthoritative; + RecallMatch.MatchScore = 73; + RecallMatch.MatchReasonLines = { + TEXT("Derived coach-memory signal remains relevant."), + TEXT("Kept revocable under shared-context rules.") + }; + RecallMatch.ProvenanceLinks = CoachMemoryProvenance; + return RecallMatch; + }(), + [&]() + { + FHyperTwistMemoryRecallMatch RecallMatch; + RecallMatch.MatchId = TEXT("memory-recall-match/sidecar-brief"); + RecallMatch.MatchKind = TEXT("sidecar-brief"); + RecallMatch.Headline = TEXT("Sidecar brief preserves the current bounded follow-up"); + RecallMatch.UserId = UserId; + RecallMatch.DeckId = TEXT("classic-3x3"); + RecallMatch.SourceEntityId = + TEXT("memory-entity/shared/sidecar-brief/local-user"); + RecallMatch.SourceRecordKind = TEXT("sidecar-brief"); + RecallMatch.SourceRecordId = TEXT("sidecar-brief-001"); + RecallMatch.ReferenceUtc = ReferenceUtc; + RecallMatch.Lane = EHyperTwistMemoryLane::RecallRetrieval; + RecallMatch.AuthorityKind = EHyperTwistMemoryAuthorityKind::SemiAuthoritative; + RecallMatch.MatchScore = 65; + RecallMatch.MatchReasonLines = { + TEXT("Useful for bounded sidecar coordination."), + TEXT("Requires authoritative provenance before widening.") + }; + RecallMatch.ProvenanceLinks = SidecarProvenance; + return RecallMatch; + }() + }; + RecallState.ProvenanceDrillDownEntries = { + [&]() + { + FHyperTwistMemoryProvenanceDrillDownEntry DrillDownEntry; + DrillDownEntry.DrillDownId = TEXT("memory-provenance-drilldown/review-program"); + DrillDownEntry.RootEntityId = + TEXT("memory-entity/recall/review-program-summary/local-user"); + DrillDownEntry.RootRecordKind = TEXT("review-program-summary"); + DrillDownEntry.Headline = + TEXT("Review program summary keeps authoritative recall lineage"); + DrillDownEntry.Lane = EHyperTwistMemoryLane::RecallRetrieval; + DrillDownEntry.AuthorityKind = EHyperTwistMemoryAuthorityKind::Authoritative; + DrillDownEntry.LineageEntityIds = { + TEXT("memory-entity/recall/review-program-summary/local-user"), + TEXT("memory-entity/chronicle/run-record-001") + }; + DrillDownEntry.SourceLabels = { + TEXT("review-program-fixture"), + TEXT("chronicle-fixture") + }; + DrillDownEntry.ProvenanceDepth = DrillDownEntry.LineageEntityIds.Num(); + DrillDownEntry.bHasAuthoritativeLineage = true; + DrillDownEntry.ProvenanceLinks = ReviewProgramProvenance; + return DrillDownEntry; + }() + }; + RecallState.SharedContextRules = { + []() + { + FHyperTwistMemorySharedContextRule SharedContextRule; + SharedContextRule.RuleId = TEXT("memory-shared-context-rule/coach-follow-up"); + SharedContextRule.ContextId = TEXT("coach-follow-up"); + SharedContextRule.DisplayLabel = TEXT("Coach Follow-Up"); + SharedContextRule.SourceLane = EHyperTwistMemoryLane::SharedCoordination; + SharedContextRule.AllowedRecordKinds = { + TEXT("review-program-summary"), + TEXT("coach-memory-summary") + }; + SharedContextRule.AllowedTargetSurfaces = { + TEXT("surface/training-panel"), + TEXT("surface/coach-dashboard") + }; + SharedContextRule.bSessionLocalOnly = true; + SharedContextRule.bRevocable = true; + SharedContextRule.bRequiresAuthoritativeProvenance = true; + SharedContextRule.Summary = + TEXT("Bounded coach follow-up context remains session-local and revocable."); + return SharedContextRule; + }(), + []() + { + FHyperTwistMemorySharedContextRule SharedContextRule; + SharedContextRule.RuleId = TEXT("memory-shared-context-rule/sidecar-brief"); + SharedContextRule.ContextId = TEXT("sidecar-brief"); + SharedContextRule.DisplayLabel = TEXT("Sidecar Brief"); + SharedContextRule.SourceLane = EHyperTwistMemoryLane::SharedCoordination; + SharedContextRule.AllowedRecordKinds = { TEXT("sidecar-brief") }; + SharedContextRule.AllowedTargetSurfaces = { + TEXT("surface/browser-sidecar"), + TEXT("surface/diagnostics-panel") + }; + SharedContextRule.bSessionLocalOnly = true; + SharedContextRule.bRevocable = true; + SharedContextRule.bRequiresAuthoritativeProvenance = true; + SharedContextRule.Summary = + TEXT("Sidecar context remains bounded to revocable provenance-qualified briefs."); + return SharedContextRule; + }(), + []() + { + FHyperTwistMemorySharedContextRule SharedContextRule; + SharedContextRule.RuleId = TEXT("memory-shared-context-rule/review-window"); + SharedContextRule.ContextId = TEXT("review-window"); + SharedContextRule.DisplayLabel = TEXT("Review Window"); + SharedContextRule.SourceLane = EHyperTwistMemoryLane::SharedCoordination; + SharedContextRule.AllowedRecordKinds = { + TEXT("training-session-template"), + TEXT("review-program-summary") + }; + SharedContextRule.AllowedTargetSurfaces = { + TEXT("surface/training-panel"), + TEXT("surface/follow-up-panel") + }; + SharedContextRule.bSessionLocalOnly = true; + SharedContextRule.bRevocable = true; + SharedContextRule.bRequiresAuthoritativeProvenance = false; + SharedContextRule.Summary = + TEXT("Review-window context preserves bounded cross-surface recall."); + return SharedContextRule; + }() + }; + RecallState.SharedContextProjections = { + [&]() + { + FHyperTwistMemorySharedContextProjection Projection; + Projection.ProjectionId = TEXT("memory-shared-context-projection/coach-follow-up"); + Projection.ContextId = TEXT("coach-follow-up"); + Projection.Headline = TEXT("Coach follow-up projection remains active"); + Projection.UserId = UserId; + Projection.ReferenceUtc = ReferenceUtc; + Projection.RuleId = TEXT("memory-shared-context-rule/coach-follow-up"); + Projection.RelatedMatchIds = { + TEXT("memory-recall-match/review-program"), + TEXT("memory-recall-match/coach-memory") + }; + Projection.RelatedEntityIds = { + TEXT("memory-entity/recall/review-program-summary/local-user"), + TEXT("memory-entity/cognitive/coach-memory-summary/local-user") + }; + Projection.bRevocable = true; + Projection.bSessionLocalOnly = true; + Projection.bRequiresAuthoritativeProvenance = true; + Projection.ProvenanceLinks = ReviewProgramProvenance; + return Projection; + }(), + [&]() + { + FHyperTwistMemorySharedContextProjection Projection; + Projection.ProjectionId = TEXT("memory-shared-context-projection/sidecar-brief"); + Projection.ContextId = TEXT("sidecar-brief"); + Projection.Headline = TEXT("Sidecar brief projection remains bounded"); + Projection.UserId = UserId; + Projection.ReferenceUtc = ReferenceUtc; + Projection.RuleId = TEXT("memory-shared-context-rule/sidecar-brief"); + Projection.RelatedMatchIds = { TEXT("memory-recall-match/sidecar-brief") }; + Projection.RelatedEntityIds = { + TEXT("memory-entity/shared/sidecar-brief/local-user") + }; + Projection.bRevocable = true; + Projection.bSessionLocalOnly = true; + Projection.bRequiresAuthoritativeProvenance = true; + Projection.ProvenanceLinks = SidecarProvenance; + return Projection; + }() + }; + RecallState.RecallResultCount = RecallState.RecallMatches.Num(); + RecallState.AuthoritativeRecallCount = 2; + RecallState.SemiAuthoritativeRecallCount = 2; + RecallState.SharedContextProjectionCount = RecallState.SharedContextProjections.Num(); + RecallState.bHasScopedSharedContext = true; + return RecallState; } FHyperTwistMemoryCognitiveConsolidationState UHyperTwistContractLibrary::MakeSampleTrainingMemoryCognitiveConsolidationState() { - 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 FHyperTwistTrainingRepositoryState RepositoryState = + HyperTwistContractLibraryInternal::BuildSampleTrainingRepositoryStateWithCoachFollowUpArtifacts(); const FString UserId = HyperTwistContractLibraryInternal::ResolveSampleRepositoryUserId(RepositoryState); if (UserId.IsEmpty()) @@ -4760,82 +5898,247 @@ FHyperTwistMemoryCognitiveConsolidationState FHyperTwistMemoryKnowledgeNotesState UHyperTwistContractLibrary::MakeSampleTrainingMemoryKnowledgeNotesState() { - FHyperTwistTrainingRepositoryState RepositoryState = MakeSampleTrainingRepositoryState(); - RepositoryState = HyperTwistContractLibraryInternal::AppendSampleCoachArtifacts(RepositoryState); + const FString UserId = TEXT("local-user"); + const FString ReferenceUtc = TEXT("2026-04-28T12:40:00Z"); + const auto KnowledgeProvenance = + TArray{ + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/knowledge/curated-reference/local-user"), + EHyperTwistMemoryLane::KnowledgeWiki, + TEXT("training-knowledge-reference"), + TEXT("knowledge-fixture") + ) + }; + const auto PromotionProvenance = + TArray{ + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/cognitive/promoted-insight/local-user"), + EHyperTwistMemoryLane::CognitiveConsolidated, + TEXT("cognitive-fact"), + TEXT("promotion-fixture"), + false + ) + }; - 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 FHyperTwistMemoryKnowledgeNotesState(); - } - - return UHyperTwistMemoryCoreLibrary::DeriveMemoryKnowledgeNotesState( - RepositoryState, - UserId, - TEXT("2026-04-28T12:40:00Z") - ); + FHyperTwistMemoryKnowledgeNotesState KnowledgeNotesState; + KnowledgeNotesState.UserId = UserId; + KnowledgeNotesState.ReferenceUtc = ReferenceUtc; + KnowledgeNotesState.KnowledgeObjects = { + [&]() + { + FHyperTwistMemoryKnowledgeObject KnowledgeObject; + KnowledgeObject.ObjectId = TEXT("memory-knowledge-object/taxonomy/local-user/f2l"); + KnowledgeObject.ObjectKind = TEXT("taxonomy-node"); + KnowledgeObject.Title = TEXT("F2L Foundations"); + KnowledgeObject.Summary = + TEXT("Curated reference object for first-two-layers progression."); + KnowledgeObject.UserId = UserId; + KnowledgeObject.ReferenceUtc = ReferenceUtc; + KnowledgeObject.ScopeLabel = TEXT("curated-reference"); + KnowledgeObject.SourceRecordIds = { TEXT("taxonomy-node-f2l") }; + KnowledgeObject.Tags = { TEXT("f2l"), TEXT("progression") }; + KnowledgeObject.ProvenanceLinks = KnowledgeProvenance; + return KnowledgeObject; + }(), + [&]() + { + FHyperTwistMemoryKnowledgeObject KnowledgeObject; + KnowledgeObject.ObjectId = TEXT("memory-knowledge-object/notation/local-user/oll"); + KnowledgeObject.ObjectKind = TEXT("notation-term"); + KnowledgeObject.Title = TEXT("OLL"); + KnowledgeObject.Summary = + TEXT("Curated notation reference for orientation of the last layer."); + KnowledgeObject.UserId = UserId; + KnowledgeObject.ReferenceUtc = ReferenceUtc; + KnowledgeObject.ScopeLabel = TEXT("curated-reference"); + KnowledgeObject.SourceRecordIds = { TEXT("notation-term-oll") }; + KnowledgeObject.Tags = { TEXT("notation"), TEXT("oll") }; + KnowledgeObject.ProvenanceLinks = KnowledgeProvenance; + return KnowledgeObject; + }(), + [&]() + { + FHyperTwistMemoryKnowledgeObject KnowledgeObject; + KnowledgeObject.ObjectId = + TEXT("memory-knowledge-object/promoted/local-user/follow-up-pressure"); + KnowledgeObject.ObjectKind = TEXT("promoted-cognitive-insight"); + KnowledgeObject.Title = TEXT("Follow-up pressure remains reviewable"); + KnowledgeObject.Summary = + TEXT("Stable promoted cognitive insight preserves bounded review pressure."); + KnowledgeObject.UserId = UserId; + KnowledgeObject.ReferenceUtc = ReferenceUtc; + KnowledgeObject.ScopeLabel = TEXT("promoted-memory-knowledge"); + KnowledgeObject.SourceRecordIds = { TEXT("cognitive-fact-follow-up-pressure") }; + KnowledgeObject.Tags = { TEXT("memory-promotion"), TEXT("follow-up") }; + KnowledgeObject.ProvenanceLinks = PromotionProvenance; + return KnowledgeObject; + }() + }; + KnowledgeNotesState.PromotionReviews = { + [&]() + { + FHyperTwistMemoryKnowledgePromotionReview PromotionReview; + PromotionReview.ReviewId = + TEXT("memory-knowledge-review/local-user/follow-up-pressure"); + PromotionReview.CandidateFactId = TEXT("cognitive-fact-follow-up-pressure"); + PromotionReview.ProposedKnowledgeObjectId = + TEXT("memory-knowledge-object/promoted/local-user/follow-up-pressure"); + PromotionReview.UserId = UserId; + PromotionReview.ReferenceUtc = ReferenceUtc; + PromotionReview.Headline = TEXT("Follow-up pressure remains reviewable"); + PromotionReview.Decision = + EHyperTwistMemoryKnowledgePromotionDecision::Approved; + PromotionReview.ReasonLabel = + TEXT("Stable high-confidence coaching insight may promote into bounded knowledge."); + PromotionReview.bNeedsManualReview = false; + PromotionReview.ProvenanceLinks = PromotionProvenance; + return PromotionReview; + }(), + [&]() + { + FHyperTwistMemoryKnowledgePromotionReview PromotionReview; + PromotionReview.ReviewId = + TEXT("memory-knowledge-review/local-user/contradiction-blocked"); + PromotionReview.CandidateFactId = TEXT("cognitive-fact-contradiction-blocked"); + PromotionReview.ProposedKnowledgeObjectId = + TEXT("memory-knowledge-object/promoted/local-user/contradiction-blocked"); + PromotionReview.UserId = UserId; + PromotionReview.ReferenceUtc = ReferenceUtc; + PromotionReview.Headline = + TEXT("Contradicted coaching insight stays reviewable"); + PromotionReview.Decision = + EHyperTwistMemoryKnowledgePromotionDecision::Blocked; + PromotionReview.ReasonLabel = + TEXT("Contradicted memory insight must remain blocked for review safety."); + PromotionReview.bNeedsManualReview = true; + PromotionReview.BlockingContradictionIds = { + TEXT("memory-cognitive-contradiction/follow-up-pressure") + }; + PromotionReview.ProvenanceLinks = PromotionProvenance; + return PromotionReview; + }() + }; + KnowledgeNotesState.UserNotesPosture.UserId = UserId; + KnowledgeNotesState.UserNotesPosture.ReferenceUtc = ReferenceUtc; + KnowledgeNotesState.UserNotesPosture.GateId = TEXT("memory-gate/user-notes"); + KnowledgeNotesState.UserNotesPosture.SettingsKey = TEXT("memory.user_notes.enabled"); + KnowledgeNotesState.UserNotesPosture.Headline = + TEXT("User-authored note lane remains separately gated"); + KnowledgeNotesState.UserNotesPosture.SummaryLine = + TEXT("User-authored notes stay disabled until explicit first-party activation is proven."); + KnowledgeNotesState.UserNotesPosture.bOwnershipJustified = true; + KnowledgeNotesState.UserNotesPosture.bLaneEnabled = false; + KnowledgeNotesState.UserNotesPosture.bAcceptsUserAuthoredContent = false; + KnowledgeNotesState.UserNotesPosture.bRequiresSeparateOwnerActivation = true; + KnowledgeNotesState.UserNotesPosture.ProvenanceLinks = { + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/policy/current/local-user"), + EHyperTwistMemoryLane::IdentityPolicy, + TEXT("memory-policy-profile"), + TEXT("user-notes-policy") + ), + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/provenance/ledger/current/local-user"), + EHyperTwistMemoryLane::ProvenanceLedger, + TEXT("memory-ledger-contract"), + TEXT("user-notes-ledger") + ) + }; + KnowledgeNotesState.CuratedReferenceObjectCount = 2; + KnowledgeNotesState.ApprovedPromotionCount = 1; + KnowledgeNotesState.DeferredPromotionCount = 0; + KnowledgeNotesState.BlockedPromotionCount = 1; + KnowledgeNotesState.bKnowledgeWikiEnabled = true; + KnowledgeNotesState.bUserNotesLaneAvailable = false; + return KnowledgeNotesState; } FHyperTwistMemoryDerivedAdjunctState UHyperTwistContractLibrary::MakeSampleTrainingMemoryDerivedAdjunctState() { - FHyperTwistTrainingRepositoryState RepositoryState = MakeSampleTrainingRepositoryState(); - RepositoryState = HyperTwistContractLibraryInternal::AppendSampleCoachArtifacts(RepositoryState); + const FString UserId = TEXT("local-user"); + const FString ReferenceUtc = TEXT("2026-04-28T12:40:00Z"); + const auto DerivedProvenance = + TArray{ + HyperTwistContractLibraryInternal::MakeSampleMemoryProvenanceLink( + TEXT("memory-entity/recall/review-program-summary/local-user"), + EHyperTwistMemoryLane::RecallRetrieval, + TEXT("review-program-summary"), + TEXT("derived-source") + ) + }; - 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 - ); + FHyperTwistMemoryDerivedAdjunctState DerivedAdjunctState; + DerivedAdjunctState.UserId = UserId; + DerivedAdjunctState.ReferenceUtc = ReferenceUtc; + DerivedAdjunctState.ContextAssemblyProfile = + EHyperTwistMemoryContextAssemblyProfile::MaxRetentionMode; + DerivedAdjunctState.FeatureGateId = TEXT("memory-gate/derived-compacted"); + DerivedAdjunctState.SettingsKey = TEXT("memory.derived_compacted.enabled"); + DerivedAdjunctState.CompactSummaries = { + [&]() + { + FHyperTwistMemoryCompactSummary CompactSummary; + CompactSummary.SummaryId = TEXT("memory-compact-summary/overview/local-user"); + CompactSummary.SummaryKind = TEXT("memory-overview"); + CompactSummary.Headline = TEXT("Memory overview remains available"); + CompactSummary.SummaryText = + TEXT("Bounded overview keeps review pressure and follow-up continuity visible."); + CompactSummary.UserId = UserId; + CompactSummary.ReferenceUtc = ReferenceUtc; + CompactSummary.SourceEntityIds = { + TEXT("memory-entity/recall/review-program-summary/local-user") + }; + CompactSummary.ProvenanceLinks = DerivedProvenance; + return CompactSummary; + }() + }; + DerivedAdjunctState.ReducedContextPackets = { + [&]() + { + FHyperTwistMemoryReducedContextPacket ReducedContextPacket; + ReducedContextPacket.PacketId = TEXT("memory-reduced-context/review/local-user"); + ReducedContextPacket.PacketKind = TEXT("review-follow-up-packet"); + ReducedContextPacket.Headline = TEXT("Reduced review context remains bounded"); + ReducedContextPacket.PacketBody = + TEXT("Resume the bounded review plan with provenance-qualified follow-up pressure."); + ReducedContextPacket.UserId = UserId; + ReducedContextPacket.ReferenceUtc = ReferenceUtc; + ReducedContextPacket.MaxTokenHint = 256; + ReducedContextPacket.SourceEntityIds = { + TEXT("memory-entity/recall/review-program-summary/local-user") + }; + ReducedContextPacket.ProvenanceLinks = DerivedProvenance; + return ReducedContextPacket; + }() + }; + DerivedAdjunctState.DigestViews = { + [&]() + { + FHyperTwistMemoryDigestView DigestView; + DigestView.DigestId = TEXT("memory-digest-view/follow-up/local-user"); + DigestView.DigestKind = TEXT("follow-up-digest"); + DigestView.Title = TEXT("Follow-up digest"); + DigestView.SummaryLine = + TEXT("Bounded digest keeps authoritative review pressure visible."); + DigestView.UserId = UserId; + DigestView.ReferenceUtc = ReferenceUtc; + DigestView.SourceEntityIds = { + TEXT("memory-entity/recall/review-program-summary/local-user") + }; + DigestView.ProvenanceLinks = DerivedProvenance; + return DigestView; + }() + }; + DerivedAdjunctState.CompactSummaryCount = DerivedAdjunctState.CompactSummaries.Num(); + DerivedAdjunctState.ReducedContextPacketCount = + DerivedAdjunctState.ReducedContextPackets.Num(); + DerivedAdjunctState.DigestViewCount = DerivedAdjunctState.DigestViews.Num(); + DerivedAdjunctState.bDerivedGateActive = true; + DerivedAdjunctState.bDerivedOnlyStorageConfirmed = true; + DerivedAdjunctState.bRemovableWithoutLineageLoss = true; + DerivedAdjunctState.bAllFeaturesOffSafe = true; + return DerivedAdjunctState; } FHyperTwistSkillRegistryState UHyperTwistContractLibrary::MakeSampleSkillRegistryState() diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistRecognition/HyperTwistRecognitionTypes.cpp b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistRecognition/HyperTwistRecognitionTypes.cpp new file mode 100644 index 0000000..6405864 --- /dev/null +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistRecognition/HyperTwistRecognitionTypes.cpp @@ -0,0 +1,968 @@ +#include "HyperTwistRecognition/HyperTwistRecognitionTypes.h" + +namespace HyperTwistRecognitionTypesInternal +{ + bool AreAllStringsPopulated(const TArray& Values) + { + for (const FString& Value : Values) + { + if (Value.IsEmpty()) + { + return false; + } + } + + return true; + } + + template + bool AreAllItemsStructurallyValid(const TArray& Items) + { + for (const ItemType& Item : Items) + { + if (!Item.IsStructurallyValid()) + { + return false; + } + } + + return true; + } +} + +bool FHyperTwistSpeechNativeCaptureRouteShellProfile::IsStructurallyValid() const +{ + return !NativeCaptureRouteShellProfileId.IsEmpty() + && !ShellKind.IsEmpty() + && !OwnershipSummarySurfaceMode.IsEmpty() + && !PreparationSurfaceMode.IsEmpty() + && !SessionReopenSurfaceMode.IsEmpty() + && !RouteInspectActionId.IsEmpty() + && !PreparationRetryActionId.IsEmpty() + && !SessionReopenActionId.IsEmpty() + && !PermissionDependencyActionId.IsEmpty() + && Panels.Num() > 0 + && ActionBindings.Num() > 0 + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(Panels) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(ActionBindings); +} + +bool FHyperTwistSpeechNativeCaptureRouteShellState::IsStructurallyValid() const +{ + if (NativeCaptureRouteShellProfileId.IsEmpty() + || NativeCaptureRouteWorkflowProfileId.IsEmpty() + || ActiveProviderProfileId.IsEmpty() + || ActiveServiceLaneId.IsEmpty() + || WorkflowStateId.IsEmpty() + || CaptureRouteStateId.IsEmpty() + || PermissionStateId.IsEmpty() + || LatestSourceKind.IsEmpty() + || StatusLine.IsEmpty() + || DetailLine.IsEmpty() + || ActiveIssueCount < 0 + || AvailableActionIds.Num() <= 0) + { + return false; + } + + if (ActiveIssueCount != Issues.Num()) + { + return false; + } + + return (ActiveIssueCount <= 0 || ActiveIssue.IsStructurallyValid()) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(Entries) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(Issues) + && HyperTwistRecognitionTypesInternal::AreAllStringsPopulated(AvailableActionIds); +} + +bool FHyperTwistSpeechUsageCostDashboardShellProfile::IsStructurallyValid() const +{ + return !DashboardShellProfileId.IsEmpty() + && !ShellKind.IsEmpty() + && !UsageSurfaceMode.IsEmpty() + && !CostSurfaceMode.IsEmpty() + && !EscalationBannerMode.IsEmpty() + && !RefreshActionId.IsEmpty() + && !RouteInspectActionId.IsEmpty() + && !BudgetInspectActionId.IsEmpty() + && Panels.Num() > 0 + && ActionBindings.Num() > 0 + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(Panels) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(ActionBindings); +} + +bool FHyperTwistSpeechUsageCostDashboardShellState::IsStructurallyValid() const +{ + if (DashboardShellProfileId.IsEmpty() + || ActiveProviderProfileId.IsEmpty() + || ActiveProviderDisplayLabel.IsEmpty() + || ActiveServiceLaneId.IsEmpty() + || ActiveRouteStateId.IsEmpty() + || UsageAggregationWindowId.IsEmpty() + || CostAggregationWindowId.IsEmpty() + || UsageMeterKind.IsEmpty() + || CurrencyCode.IsEmpty() + || StatusLine.IsEmpty() + || DetailLine.IsEmpty() + || LatestUsageEventId.IsEmpty() + || LatestCostEventId.IsEmpty() + || LatestQuotaStateId.IsEmpty() + || LatestRouteDecisionId.IsEmpty() + || DisplayedUsageQuantity < 0.0f + || DisplayedEstimatedCostUsd < 0.0f + || DisplayedReportedCostUsd < 0.0f + || RemainingEstimatedSpendUsd < 0.0f + || RemainingRequestCount < 0 + || RemainingAudioSeconds < 0 + || ActiveIssueCount < 0 + || AvailableActionIds.Num() <= 0) + { + return false; + } + + if (ActiveIssueCount != Issues.Num()) + { + return false; + } + + return (ActiveIssueCount <= 0 || ActiveIssue.IsStructurallyValid()) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(Issues) + && HyperTwistRecognitionTypesInternal::AreAllStringsPopulated(AvailableActionIds); +} + +bool FHyperTwistVisionShellProfile::IsStructurallyValid() const +{ + return !ShellProfileId.IsEmpty() + && !ShellKind.IsEmpty() + && !DefaultLocaleCode.IsEmpty() + && !FontReviewProfileId.IsEmpty() + && FontReviewProfileDefinition.IsStructurallyValid() + && SupportedFontReviews.Num() > 0 + && SupportedLocales.Num() > 0 + && Panels.Num() > 0 + && ActionBindings.Num() > 0 + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(SupportedLocales) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(SupportedFontReviews) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(Panels) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(ActionBindings); +} + +bool FHyperTwistVisionSolveExplanationProfile::IsStructurallyValid() const +{ + return !ExplanationProfileId.IsEmpty() + && !PuzzleId.IsEmpty() + && !RecommendationMode.IsEmpty() + && !LocaleGuidanceMode.IsEmpty() + && !DefaultLocaleCode.IsEmpty() + && !StartingOrientationHint.IsEmpty() + && !FontReviewProfileId.IsEmpty() + && FontReviewProfileDefinition.IsStructurallyValid() + && SupportedFontReviews.Num() > 0 + && SupportedLocales.Num() > 0 + && Steps.Num() > 0 + && ActionBindings.Num() > 0 + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(SupportedLocales) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(SupportedFontReviews) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(Steps) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(ActionBindings); +} + +bool FHyperTwistVisionCorrectionState::IsStructurallyValid() const +{ + if (CorrectionProfileId.IsEmpty() + || MissingFaceCount < 0 + || ContradictionCount < 0 + || ContradictionCount != Contradictions.Num() + || ResolvedCorrectionCount < 0 + || ResolvedCorrectionCount != ResolutionLedger.Num()) + { + return false; + } + + if (bCorrectionRequired + && (ActiveTargetFaceId.IsEmpty() + || !ActiveTarget.IsStructurallyValid() + || ActiveTargetFaceId != ActiveTarget.FaceId)) + { + return false; + } + + return HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(PendingTargets) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(Contradictions) + && (LastResolution.ResolutionId.IsEmpty() || LastResolution.IsStructurallyValid()) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(ResolutionLedger); +} + +bool FHyperTwistSpeechProviderRoutingPolicy::IsStructurallyValid() const +{ + return !ProviderRoutingPolicyId.IsEmpty() + && !PolicyKind.IsEmpty() + && !RouteSelectionMode.IsEmpty() + && !FallbackMode.IsEmpty() + && !WorkflowPolicyState.IsEmpty() + && !FailureEscalationMode.IsEmpty() + && !UserOverridePosture.IsEmpty() + && EligibleProviderClasses.Num() > 0 + && EligibleEndpointClasses.Num() > 0 + && RequiredCapabilityFlags.Num() > 0 + && SupportedTaskKinds.Num() > 0 + && HyperTwistRecognitionTypesInternal::AreAllStringsPopulated(EligibleProviderClasses) + && HyperTwistRecognitionTypesInternal::AreAllStringsPopulated(EligibleEndpointClasses) + && HyperTwistRecognitionTypesInternal::AreAllStringsPopulated(RequiredCapabilityFlags) + && HyperTwistRecognitionTypesInternal::AreAllStringsPopulated(SupportedTaskKinds); +} + +namespace HyperTwistRecognitionTypeValidation +{ + template + bool AreStructurallyValidEntries(const TArray& Values) + { + return HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(Values); + } + + bool AreNonEmptyStrings(const TArray& Values) + { + return HyperTwistRecognitionTypesInternal::AreAllStringsPopulated(Values); + } + + bool AreSpeechModelPayloadsValid(const TArray& Payloads) + { + return AreStructurallyValidEntries(Payloads); + } + + bool HasValidSpeechSessionCore(const FHyperTwistSpeechSessionConfig& Session) + { + return !Session.SessionId.IsEmpty() + && !Session.ListeningContractId.IsEmpty() + && !Session.InputRouteId.IsEmpty() + && !Session.AudioEncoding.IsEmpty() + && Session.SampleRateHz > 0 + && Session.ChannelCount > 0 + && !Session.TaskKind.IsEmpty() + && Session.RequiredModelPayloads.Num() > 0 + && Session.VadPolicy.IsStructurallyValid() + && Session.OrchestrationProfile.IsStructurallyValid(); + } + + bool HasValidSpeechSessionProfiles(const FHyperTwistSpeechSessionConfig& Session) + { + return !Session.MicrophoneShellProfileId.IsEmpty() + && Session.MicrophoneShellProfileDefinition.IsStructurallyValid() + && !Session.DevicePermissionWorkflowProfileId.IsEmpty() + && Session.DevicePermissionWorkflowProfileDefinition.IsStructurallyValid() + && !Session.NativeCaptureRouteWorkflowProfileId.IsEmpty() + && Session.NativeCaptureRouteWorkflowProfileDefinition.IsStructurallyValid() + && !Session.NativeCaptureRouteShellProfileId.IsEmpty() + && Session.NativeCaptureRouteShellProfileDefinition.IsStructurallyValid() + && !Session.ExternalDictationShellProfileId.IsEmpty() + && Session.ExternalDictationShellProfileDefinition.IsStructurallyValid() + && !Session.ProviderProfileId.IsEmpty() + && Session.ProviderProfileDefinition.IsStructurallyValid() + && !Session.ByokCustodyProfileId.IsEmpty() + && Session.ByokCustodyProfileDefinition.IsStructurallyValid() + && !Session.ProviderRoutingPolicyId.IsEmpty() + && Session.ProviderRoutingPolicyDefinition.IsStructurallyValid() + && Session.ProviderRouteDecision.IsStructurallyValid() + && !Session.UsageCostAccountingProfileId.IsEmpty() + && Session.UsageCostAccountingProfileDefinition.IsStructurallyValid() + && Session.UsageEventTemplate.IsStructurallyValid() + && Session.CostEventTemplate.IsStructurallyValid() + && !Session.UsageCostDashboardShellProfileId.IsEmpty() + && Session.UsageCostDashboardShellProfileDefinition.IsStructurallyValid() + && !Session.UsageCostHistoryExportShellProfileId.IsEmpty() + && Session.UsageCostHistoryExportShellProfileDefinition.IsStructurallyValid() + && !Session.ProviderReceiptReviewShellProfileId.IsEmpty() + && Session.ProviderReceiptReviewShellProfileDefinition.IsStructurallyValid() + && !Session.ProviderBillingSettlementShellProfileId.IsEmpty() + && Session.ProviderBillingSettlementShellProfileDefinition.IsStructurallyValid() + && !Session.ProviderSettlementExceptionShellProfileId.IsEmpty() + && Session.ProviderSettlementExceptionShellProfileDefinition.IsStructurallyValid() + && !Session.PayloadCustodyProfileId.IsEmpty() + && Session.PayloadCustodyProfileDefinition.IsStructurallyValid(); + } + + bool HasValidTranscriptCore(const FHyperTwistSpeechTranscriptResult& Transcript) + { + return !Transcript.SessionId.IsEmpty() + && !Transcript.UtteranceId.IsEmpty() + && !Transcript.TaskKind.IsEmpty() + && (!Transcript.TranscriptText.IsEmpty() || Transcript.Segments.Num() > 0) + && !Transcript.OrchestrationProfileId.IsEmpty() + && !Transcript.ServiceLaneId.IsEmpty() + && Transcript.RequestedBatchSize > 0 + && Transcript.ProcessedClipCount > 0 + && Transcript.AppliedBatchCollectionWindowMs > 0 + && Transcript.LanguageProbability >= 0.0f + && !Transcript.AppliedPromptRoutingModeId.IsEmpty() + && !Transcript.AppliedRetrievalContextLaneId.IsEmpty(); + } + + bool AreTranscriptSegmentsValid(const TArray& Segments) + { + return AreStructurallyValidEntries(Segments); + } + + bool HasValidSpeechServiceHealthCore(const FHyperTwistSpeechServiceHealth& Health) + { + return !Health.ProviderLabel.IsEmpty() + && !Health.ServiceVersion.IsEmpty() + && !Health.ProviderProfileId.IsEmpty() + && Health.ProviderProfileDefinition.IsStructurallyValid() + && !Health.ByokCustodyProfileId.IsEmpty() + && Health.ByokCustodyProfileDefinition.IsStructurallyValid() + && !Health.ProviderRoutingPolicyId.IsEmpty() + && Health.ProviderRoutingPolicyDefinition.IsStructurallyValid() + && Health.ProviderRouteDecision.IsStructurallyValid() + && !Health.UsageCostAccountingProfileId.IsEmpty() + && Health.UsageCostAccountingProfileDefinition.IsStructurallyValid() + && Health.LatestUsageEvent.IsStructurallyValid() + && Health.LatestCostEvent.IsStructurallyValid() + && Health.QuotaRateLimitState.IsStructurallyValid() + && !Health.PayloadCustodyProfileId.IsEmpty() + && Health.PayloadCustodyProfileDefinition.IsStructurallyValid(); + } + + bool HasValidExternalDictationShellProfileCore( + const FHyperTwistSpeechExternalDictationShellProfile& Profile) + { + return !Profile.ExternalDictationShellProfileId.IsEmpty() + && !Profile.ShellKind.IsEmpty() + && !Profile.TranscriptHistorySurfaceMode.IsEmpty() + && !Profile.OutputRoutingSurfaceMode.IsEmpty() + && !Profile.PostProcessOverlaySurfaceMode.IsEmpty() + && !Profile.GlobalHotkeySurfaceMode.IsEmpty() + && !Profile.InputDeviceSurfaceMode.IsEmpty() + && !Profile.OutputDeviceSurfaceMode.IsEmpty() + && !Profile.MuteSurfaceMode.IsEmpty() + && !Profile.MicrophoneModeSurfaceMode.IsEmpty() + && !Profile.LocalModelCatalogSurfaceMode.IsEmpty() + && !Profile.ModelIntegritySurfaceMode.IsEmpty() + && !Profile.ModelUnloadSurfaceMode.IsEmpty() + && !Profile.StartCaptureActionId.IsEmpty() + && !Profile.CancelCaptureActionId.IsEmpty() + && !Profile.CycleOutputRouteActionId.IsEmpty() + && !Profile.CopyTranscriptActionId.IsEmpty() + && !Profile.PasteTranscriptActionId.IsEmpty() + && !Profile.ScriptDispatchActionId.IsEmpty() + && !Profile.TogglePostProcessOverlayActionId.IsEmpty() + && !Profile.ReopenSpeechSessionActionId.IsEmpty() + && !Profile.RouteInspectActionId.IsEmpty() + && !Profile.InspectGlobalHotkeyActionId.IsEmpty() + && !Profile.CycleInputDeviceActionId.IsEmpty() + && !Profile.CycleOutputDeviceActionId.IsEmpty() + && !Profile.ToggleMuteWhileRecordingActionId.IsEmpty() + && !Profile.ToggleMicrophoneModeActionId.IsEmpty() + && !Profile.InspectLocalModelCatalogActionId.IsEmpty() + && !Profile.ReviewLocalModelIntegrityActionId.IsEmpty() + && !Profile.ReviewLocalModelUnloadPolicyActionId.IsEmpty() + && !Profile.PrimaryHotkeyBindingLabel.IsEmpty() + && !Profile.PostProcessHotkeyBindingLabel.IsEmpty() + && Profile.RetainedHistoryEntryLimit > 0 + && Profile.Panels.Num() > 0 + && Profile.ActionBindings.Num() > 0; + } + + bool HasValidExternalDictationShellStateCore(const FHyperTwistSpeechExternalDictationShellState& State) + { + return !State.ExternalDictationShellProfileId.IsEmpty() + && !State.ActiveProviderProfileId.IsEmpty() + && !State.ActiveServiceLaneId.IsEmpty() + && !State.SelectedOutputRouteId.IsEmpty() + && !State.TranscriptHistorySurfaceModeId.IsEmpty() + && !State.OutputRoutingSurfaceModeId.IsEmpty() + && !State.PostProcessOverlaySurfaceModeId.IsEmpty() + && !State.GlobalHotkeySurfaceModeId.IsEmpty() + && !State.InputDeviceSurfaceModeId.IsEmpty() + && !State.OutputDeviceSurfaceModeId.IsEmpty() + && !State.MuteSurfaceModeId.IsEmpty() + && !State.MicrophoneModeSurfaceModeId.IsEmpty() + && !State.LocalModelCatalogSurfaceModeId.IsEmpty() + && !State.ModelIntegritySurfaceModeId.IsEmpty() + && !State.ModelUnloadSurfaceModeId.IsEmpty() + && !State.LatestSourceKind.IsEmpty() + && !State.StatusLine.IsEmpty() + && !State.DetailLine.IsEmpty() + && !State.PrimaryHotkeyBindingLabel.IsEmpty() + && !State.PostProcessHotkeyBindingLabel.IsEmpty() + && !State.SelectedInputDeviceId.IsEmpty() + && !State.SelectedInputDeviceLabel.IsEmpty() + && !State.SelectedOutputDeviceId.IsEmpty() + && !State.SelectedOutputDeviceLabel.IsEmpty() + && !State.MicrophoneModeId.IsEmpty() + && !State.PayloadCustodyProfileId.IsEmpty() + && !State.SelectedPrimaryPayloadId.IsEmpty() + && State.HistoryEntryCount >= 0 + && State.PostProcessedEntryCount >= 0 + && State.SavedEntryCount >= 0 + && State.ModelCatalogEntryCount >= 0 + && State.OptionalModelCatalogEntryCount >= 0 + && State.DownloadDeferredModelEntryCount >= 0 + && State.IntegrityReviewRequiredEntryCount >= 0 + && State.ActiveIssueCount >= 0 + && State.OutputRouteOptions.Num() > 0 + && State.InputDeviceOptions.Num() > 0 + && State.OutputDeviceOptions.Num() > 0 + && State.ModelCatalogEntries.Num() > 0 + && State.AvailableActionIds.Num() > 0; + } + + bool HasConsistentExternalDictationShellStateCounts(const FHyperTwistSpeechExternalDictationShellState& State) + { + return State.HistoryEntryCount == State.HistoryEntries.Num() + && State.PostProcessedEntryCount <= State.HistoryEntryCount + && State.SavedEntryCount <= State.HistoryEntryCount + && State.ModelCatalogEntryCount == State.ModelCatalogEntries.Num() + && State.OptionalModelCatalogEntryCount <= State.ModelCatalogEntryCount + && State.DownloadDeferredModelEntryCount <= State.ModelCatalogEntryCount + && State.IntegrityReviewRequiredEntryCount <= State.ModelCatalogEntryCount; + } + + bool HasConsistentExternalDictationShellStateLatestEntry(const FHyperTwistSpeechExternalDictationShellState& State) + { + return State.HistoryEntryCount <= 0 + || (!State.LatestHistoryEntryId.IsEmpty() && !State.LatestTranscriptText.IsEmpty()); + } + + bool HasConsistentExternalDictationShellStateActiveIssue(const FHyperTwistSpeechExternalDictationShellState& State) + { + return State.ActiveIssueCount == State.Issues.Num() + && (State.ActiveIssueCount <= 0 || State.ActiveIssue.IsStructurallyValid()); + } +} + +bool FHyperTwistSpeechUsageCostHistoryExportShellState::IsStructurallyValid() const +{ + if (HistoryExportShellProfileId.IsEmpty() + || ActiveProviderProfileId.IsEmpty() + || ActiveProviderDisplayLabel.IsEmpty() + || ActiveServiceLaneId.IsEmpty() + || SelectedHistoryWindowId.IsEmpty() + || ExportPreviewFormatId.IsEmpty() + || LatestSourceKind.IsEmpty() + || StatusLine.IsEmpty() + || DetailLine.IsEmpty() + || HistoryEntryCount < 0 + || EstimateOnlyEntryCount < 0 + || ProviderReceiptEntryCount < 0 + || TotalUsageQuantity < 0.0f + || TotalEstimatedCostUsd < 0.0f + || TotalReportedCostUsd < 0.0f + || LowestRemainingEstimatedSpendUsd < 0.0f + || ActiveIssueCount < 0 + || AvailableActionIds.Num() <= 0) + { + return false; + } + + return HistoryEntryCount == HistoryEntries.Num() + && (HistoryEntryCount <= 0 || !LatestHistoryEntryId.IsEmpty()) + && (!bExportPreviewReady || !ExportPreviewText.IsEmpty()) + && ActiveIssueCount == Issues.Num() + && (ActiveIssueCount <= 0 || ActiveIssue.IsStructurallyValid()) + && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(Issues) + && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(HistoryEntries) + && HyperTwistRecognitionTypeValidation::AreNonEmptyStrings(AvailableActionIds); +} + +bool FHyperTwistSpeechProviderReceiptReviewShellState::IsStructurallyValid() const +{ + if (ReceiptReviewShellProfileId.IsEmpty() + || ActiveProviderProfileId.IsEmpty() + || ActiveProviderDisplayLabel.IsEmpty() + || ActiveServiceLaneId.IsEmpty() + || SelectedChargeWindowId.IsEmpty() + || PostedChargeInspectionModeId.IsEmpty() + || LatestSourceKind.IsEmpty() + || StatusLine.IsEmpty() + || DetailLine.IsEmpty() + || ReceiptEntryCount < 0 + || ProviderPostedChargeCount < 0 + || EstimateOnlyEntryCount < 0 + || VarianceReviewEntryCount < 0 + || TotalEstimatedCostUsd < 0.0f + || TotalReportedCostUsd < 0.0f + || TotalAbsoluteVarianceUsd < 0.0f + || HighestAbsoluteVarianceUsd < 0.0f + || ActiveIssueCount < 0 + || AvailableActionIds.Num() <= 0) + { + return false; + } + + return ReceiptEntryCount == ReceiptEntries.Num() + && ProviderPostedChargeCount <= ReceiptEntryCount + && EstimateOnlyEntryCount <= ReceiptEntryCount + && VarianceReviewEntryCount <= ReceiptEntryCount + && (ReceiptEntryCount <= 0 || !LatestReceiptEntryId.IsEmpty()) + && (!bReceiptSummaryReady || !ReceiptSummaryText.IsEmpty()) + && ActiveIssueCount == Issues.Num() + && (ActiveIssueCount <= 0 || ActiveIssue.IsStructurallyValid()) + && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(Issues) + && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(ReceiptEntries) + && HyperTwistRecognitionTypeValidation::AreNonEmptyStrings(AvailableActionIds); +} + +bool FHyperTwistSpeechProviderBillingSettlementShellState::IsStructurallyValid() const +{ + if (BillingSettlementShellProfileId.IsEmpty() + || ActiveProviderProfileId.IsEmpty() + || ActiveProviderDisplayLabel.IsEmpty() + || ActiveServiceLaneId.IsEmpty() + || SelectedSettlementWindowId.IsEmpty() + || SettlementSurfaceModeId.IsEmpty() + || InvoiceReconciliationModeId.IsEmpty() + || LatestSourceKind.IsEmpty() + || StatusLine.IsEmpty() + || DetailLine.IsEmpty() + || SettlementEntryCount < 0 + || ProviderPostedChargeCount < 0 + || ReconciliationReadyEntryCount < 0 + || EstimateOnlyEntryCount < 0 + || ManualReviewEntryCount < 0 + || BlockedSettlementEntryCount < 0 + || TotalEstimatedCostUsd < 0.0f + || TotalReportedCostUsd < 0.0f + || TotalSettlementDeltaUsd < 0.0f + || HighestSettlementDeltaUsd < 0.0f + || ActiveIssueCount < 0 + || AvailableActionIds.Num() <= 0) + { + return false; + } + + return SettlementEntryCount == SettlementEntries.Num() + && ProviderPostedChargeCount <= SettlementEntryCount + && ReconciliationReadyEntryCount <= SettlementEntryCount + && EstimateOnlyEntryCount <= SettlementEntryCount + && ManualReviewEntryCount <= SettlementEntryCount + && BlockedSettlementEntryCount <= SettlementEntryCount + && (SettlementEntryCount <= 0 || !LatestSettlementEntryId.IsEmpty()) + && (!bSettlementSummaryReady || !SettlementSummaryText.IsEmpty()) + && ActiveIssueCount == Issues.Num() + && (ActiveIssueCount <= 0 || ActiveIssue.IsStructurallyValid()) + && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(Issues) + && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(SettlementEntries) + && HyperTwistRecognitionTypeValidation::AreNonEmptyStrings(AvailableActionIds); +} + +bool FHyperTwistSpeechProviderSettlementExceptionShellState::IsStructurallyValid() const +{ + if (SettlementExceptionShellProfileId.IsEmpty() + || ActiveProviderProfileId.IsEmpty() + || ActiveProviderDisplayLabel.IsEmpty() + || ActiveServiceLaneId.IsEmpty() + || SelectedSettlementWindowId.IsEmpty() + || ExceptionSurfaceModeId.IsEmpty() + || ExternalPortalHandoffModeId.IsEmpty() + || LatestSourceKind.IsEmpty() + || StatusLine.IsEmpty() + || DetailLine.IsEmpty() + || ExceptionEntryCount < 0 + || ExternalPortalHandoffReadyEntryCount < 0 + || PendingChargeEntryCount < 0 + || ManualReviewEntryCount < 0 + || RouteDegradedEntryCount < 0 + || BlockedSettlementEntryCount < 0 + || TotalEstimatedCostUsd < 0.0f + || TotalReportedCostUsd < 0.0f + || TotalSettlementDeltaUsd < 0.0f + || HighestSettlementDeltaUsd < 0.0f + || ActiveIssueCount < 0 + || AvailableActionIds.Num() <= 0) + { + return false; + } + + return ExceptionEntryCount == ExceptionEntries.Num() + && ExternalPortalHandoffReadyEntryCount <= ExceptionEntryCount + && PendingChargeEntryCount <= ExceptionEntryCount + && ManualReviewEntryCount <= ExceptionEntryCount + && RouteDegradedEntryCount <= ExceptionEntryCount + && BlockedSettlementEntryCount <= ExceptionEntryCount + && (ExceptionEntryCount <= 0 || !LatestExceptionEntryId.IsEmpty()) + && (!bExceptionSummaryReady || !ExceptionSummaryText.IsEmpty()) + && ActiveIssueCount == Issues.Num() + && (ActiveIssueCount <= 0 || ActiveIssue.IsStructurallyValid()) + && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(Issues) + && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(ExceptionEntries) + && HyperTwistRecognitionTypeValidation::AreNonEmptyStrings(AvailableActionIds); +} + +bool FHyperTwistSpeechExternalDictationShellProfile::IsStructurallyValid() const +{ + return HyperTwistRecognitionTypeValidation::HasValidExternalDictationShellProfileCore(*this) + && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(Panels) + && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(ActionBindings); +} + +bool FHyperTwistSpeechExternalDictationShellState::IsStructurallyValid() const +{ + return HyperTwistRecognitionTypeValidation::HasValidExternalDictationShellStateCore(*this) + && HyperTwistRecognitionTypeValidation::HasConsistentExternalDictationShellStateCounts(*this) + && HyperTwistRecognitionTypeValidation::HasConsistentExternalDictationShellStateLatestEntry(*this) + && HyperTwistRecognitionTypeValidation::HasConsistentExternalDictationShellStateActiveIssue(*this) + && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(Issues) + && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(HistoryEntries) + && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(OutputRouteOptions) + && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(InputDeviceOptions) + && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(OutputDeviceOptions) + && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(ModelCatalogEntries) + && HyperTwistRecognitionTypeValidation::AreNonEmptyStrings(AvailableActionIds); +} + +bool FHyperTwistSpeechSessionConfig::IsStructurallyValid() const +{ + return HyperTwistRecognitionTypeValidation::HasValidSpeechSessionCore(*this) + && HyperTwistRecognitionTypeValidation::HasValidSpeechSessionProfiles(*this) + && HyperTwistRecognitionTypeValidation::AreSpeechModelPayloadsValid(RequiredModelPayloads); +} + +bool FHyperTwistSpeechTranscriptResult::IsStructurallyValid() const +{ + if (!HyperTwistRecognitionTypeValidation::HasValidTranscriptCore(*this) + || RetrievedHintCount < 0) + { + return false; + } + + if (bUsedRetrievedHintAugmentation && RetrievedHintCount <= 0) + { + return false; + } + + return RetrievedHintCount == AppliedRetrievedHints.Num() + && HyperTwistRecognitionTypeValidation::AreTranscriptSegmentsValid(Segments) + && HyperTwistRecognitionTypeValidation::AreNonEmptyStrings(AppliedRetrievedHints); +} + +bool FHyperTwistSpeechServiceHealth::IsStructurallyValid() const +{ + return HyperTwistRecognitionTypeValidation::HasValidSpeechServiceHealthCore(*this) + && HyperTwistRecognitionTypeValidation::AreNonEmptyStrings(SupportedModelPayloadIds) + && HyperTwistRecognitionTypeValidation::AreSpeechModelPayloadsValid(SupportedModelPayloads); +} + +bool FHyperTwistVoiceAssetDescriptor::IsStructurallyValid() const +{ + return !VoiceAssetId.IsEmpty() + && !VoiceProfileId.IsEmpty() + && !ArtifactName.IsEmpty() + && !RelativePathHint.IsEmpty() + && !SourceDocumentPath.IsEmpty() + && !ReviewDocumentPath.IsEmpty() + && !AcquisitionMode.IsEmpty() + && !ReviewPosture.IsEmpty() + && ApproximateSizeMiB > 0; +} + +bool FHyperTwistVoiceAssetReviewProfile::IsStructurallyValid() const +{ + return !VoiceAssetReviewProfileId.IsEmpty() + && !VoiceAssetReviewPosture.IsEmpty() + && !ShippingPosture.IsEmpty() + && !DownloadWorkflowPosture.IsEmpty() + && !ProvisioningPosture.IsEmpty() + && !CodeLicenseBoundary.IsEmpty(); +} + +bool FHyperTwistVoiceModelReviewDescriptor::IsStructurallyValid() const +{ + return !VoiceModelReviewId.IsEmpty() + && !ModelBindingId.IsEmpty() + && !VocoderBindingId.IsEmpty() + && !VoiceProfileId.IsEmpty() + && !RegistryReferencePath.IsEmpty() + && !ReviewDocumentPath.IsEmpty() + && !ModelLicensePosture.IsEmpty() + && !PayloadLicensePosture.IsEmpty() + && !AcquisitionMode.IsEmpty(); +} + +bool FHyperTwistVoiceModelReviewProfile::IsStructurallyValid() const +{ + return !VoiceModelReviewProfileId.IsEmpty() + && !ReviewPosture.IsEmpty() + && !ShippingPosture.IsEmpty() + && !DownloadWorkflowPosture.IsEmpty() + && !CodeLicenseBoundary.IsEmpty(); +} + +bool FHyperTwistVoiceProfileSummary::IsStructurallyValid() const +{ + return !VoiceProfileId.IsEmpty() + && !VoiceName.IsEmpty() + && !LanguageCode.IsEmpty() + && !LanguageFamily.IsEmpty() + && !RegionCode.IsEmpty() + && !LanguageNameEnglish.IsEmpty() + && !Quality.IsEmpty() + && NumSpeakers > 0; +} + +bool FHyperTwistVoiceProfileCatalog::IsStructurallyValid() const +{ + return Profiles.Num() > 0 + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(Profiles); +} + +bool FHyperTwistNarrationOrchestrationProfile::IsStructurallyValid() const +{ + return !OrchestrationProfileId.IsEmpty() + && !ServiceLaneId.IsEmpty() + && !ModelBindingId.IsEmpty() + && !VocoderBindingId.IsEmpty() + && !DefaultSpeakerProfileId.IsEmpty(); +} + +bool FHyperTwistNarrationSynthesisRequest::IsStructurallyValid() const +{ + return !RequestId.IsEmpty() + && !NarrationContractId.IsEmpty() + && !ServiceLaneId.IsEmpty() + && !OutputRouteId.IsEmpty() + && !VoiceProfileId.IsEmpty() + && !LanguageCode.IsEmpty() + && OrchestrationProfile.IsStructurallyValid() + && ServiceLaneId.Equals(OrchestrationProfile.ServiceLaneId, ESearchCase::CaseSensitive) + && !ScriptText.IsEmpty() + && !AudioEncodingHint.IsEmpty() + && LengthScale > 0.0f + && NoiseScale >= 0.0f + && NoiseW >= 0.0f + && SentenceSilenceSeconds >= 0.0f; +} + +bool FHyperTwistNarrationSynthesisResult::IsStructurallyValid() const +{ + return !RequestId.IsEmpty() + && !NarrationContractId.IsEmpty() + && !ServiceLaneId.IsEmpty() + && !OutputRouteId.IsEmpty() + && !VoiceProfileId.IsEmpty() + && !LanguageCode.IsEmpty() + && !OrchestrationProfileId.IsEmpty() + && !ModelBindingId.IsEmpty() + && !VocoderBindingId.IsEmpty() + && !SubtitleText.IsEmpty() + && !AudioEncoding.IsEmpty() + && SampleRateHz > 0 + && ChannelCount > 0 + && DurationMs >= 0 + && AudioBytes.Num() > 0 + && AppliedLengthScale > 0.0f + && AppliedNoiseScale >= 0.0f + && AppliedNoiseW >= 0.0f + && AppliedSentenceSilenceSeconds >= 0.0f; +} + +bool FHyperTwistVoiceServiceHealth::IsStructurallyValid() const +{ + if (ProviderLabel.IsEmpty() || ServiceVersion.IsEmpty()) + { + return false; + } + + if ((!VoiceAssetReviewProfileId.IsEmpty() + || VoiceAssetReviewProfileDefinition.IsStructurallyValid() + || SupportedVoiceAssetIds.Num() > 0 + || SupportedVoiceAssets.Num() > 0) + && (VoiceAssetReviewProfileId.IsEmpty() + || !VoiceAssetReviewProfileDefinition.IsStructurallyValid() + || SupportedVoiceAssetIds.Num() != SupportedVoiceAssets.Num())) + { + return false; + } + + if ((!VoiceModelReviewProfileId.IsEmpty() + || VoiceModelReviewProfileDefinition.IsStructurallyValid() + || SupportedVoiceModelReviewIds.Num() > 0 + || SupportedVoiceModelReviews.Num() > 0) + && (VoiceModelReviewProfileId.IsEmpty() + || !VoiceModelReviewProfileDefinition.IsStructurallyValid() + || SupportedVoiceModelReviewIds.Num() != SupportedVoiceModelReviews.Num())) + { + return false; + } + + return HyperTwistRecognitionTypesInternal::AreAllStringsPopulated(SupportedVoiceAssetIds) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(SupportedVoiceAssets) + && HyperTwistRecognitionTypesInternal::AreAllStringsPopulated(SupportedVoiceModelReviewIds) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(SupportedVoiceModelReviews); +} + +bool FHyperTwistSpeechMicrophoneShellState::IsStructurallyValid() const +{ + if (MicrophoneShellProfileId.IsEmpty() + || CaptureMode.IsEmpty() + || ListeningContractId.IsEmpty() + || InputRouteId.IsEmpty() + || PermissionStateId.IsEmpty() + || CaptureRouteStateId.IsEmpty() + || LastLanguageCode.IsEmpty() + || StatusLine.IsEmpty() + || DetailLine.IsEmpty() + || StepWindowMs <= 0 + || CaptureWindowMs < StepWindowMs + || KeepWindowMs < 0 + || KeepWindowMs > CaptureWindowMs + || SubmittedUtteranceCount < 0 + || FinalTranscriptCount < 0 + || DetectedSpeechStartMs < 0 + || DetectedSpeechEndMs < DetectedSpeechStartMs + || LastSilenceGapMs < 0 + || VadThreshold <= 0.0f + || ActiveIssueCount < 0 + || AvailableActionIds.Num() <= 0) + { + return false; + } + + return ActiveIssueCount == Issues.Num() + && (ActiveIssueCount <= 0 || ActiveIssue.IsStructurallyValid()) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(Issues) + && HyperTwistRecognitionTypesInternal::AreAllStringsPopulated(AvailableActionIds); +} + +bool FHyperTwistSpeechDevicePermissionWorkflowProfile::IsStructurallyValid() const +{ + return !DevicePermissionWorkflowProfileId.IsEmpty() + && !WorkflowKind.IsEmpty() + && !PermissionContractId.IsEmpty() + && !SettingsHandoffContractId.IsEmpty() + && !PermissionRecheckContractId.IsEmpty() + && !PermissionRequestActionId.IsEmpty() + && !OpenSettingsActionId.IsEmpty() + && !PermissionRecheckActionId.IsEmpty() + && Panels.Num() > 0 + && ActionBindings.Num() > 0 + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(Panels) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(ActionBindings); +} + +bool FHyperTwistSpeechDevicePermissionWorkflowEntry::IsStructurallyValid() const +{ + return !EntryId.IsEmpty() + && !SourceKind.IsEmpty() + && !WorkflowStateId.IsEmpty() + && !StatusLine.IsEmpty() + && !DetailLine.IsEmpty() + && !RecommendedActionId.IsEmpty(); +} + +bool FHyperTwistSpeechDevicePermissionWorkflowIssue::IsStructurallyValid() const +{ + return !IssueId.IsEmpty() + && !IssueKind.IsEmpty() + && !StatusLine.IsEmpty() + && !DetailLine.IsEmpty() + && !RecommendedActionId.IsEmpty(); +} + +bool FHyperTwistSpeechDevicePermissionWorkflowState::IsStructurallyValid() const +{ + if (DevicePermissionWorkflowProfileId.IsEmpty() + || WorkflowStateId.IsEmpty() + || PermissionStateId.IsEmpty() + || LatestSourceKind.IsEmpty() + || StatusLine.IsEmpty() + || DetailLine.IsEmpty() + || WorkflowEntryCount < 0 + || PermissionRequestEntryCount < 0 + || SettingsHandoffEntryCount < 0 + || PermissionRecheckEntryCount < 0 + || ActiveIssueCount < 0 + || AvailableActionIds.Num() <= 0) + { + return false; + } + + if (WorkflowEntryCount != Entries.Num() + || ActiveIssueCount != Issues.Num() + || PermissionRequestEntryCount > WorkflowEntryCount + || SettingsHandoffEntryCount > WorkflowEntryCount + || PermissionRecheckEntryCount > WorkflowEntryCount) + { + return false; + } + + return (ActiveIssueCount <= 0 || ActiveIssue.IsStructurallyValid()) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(Entries) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(Issues) + && HyperTwistRecognitionTypesInternal::AreAllStringsPopulated(AvailableActionIds); +} + +bool FHyperTwistSpeechNativeCaptureRouteWorkflowProfile::IsStructurallyValid() const +{ + return !NativeCaptureRouteWorkflowProfileId.IsEmpty() + && !WorkflowKind.IsEmpty() + && !OwnershipContractId.IsEmpty() + && !PreparationContractId.IsEmpty() + && !SessionReopenContractId.IsEmpty() + && !RouteInspectActionId.IsEmpty() + && !PreparationRetryActionId.IsEmpty() + && !SessionReopenActionId.IsEmpty() + && !PermissionDependencyActionId.IsEmpty() + && Panels.Num() > 0 + && ActionBindings.Num() > 0 + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(Panels) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(ActionBindings); +} + +bool FHyperTwistSpeechNativeCaptureRouteWorkflowEntry::IsStructurallyValid() const +{ + return !EntryId.IsEmpty() + && !SourceKind.IsEmpty() + && !WorkflowStateId.IsEmpty() + && !CaptureRouteStateId.IsEmpty() + && !StatusLine.IsEmpty() + && !DetailLine.IsEmpty() + && !RecommendedActionId.IsEmpty(); +} + +bool FHyperTwistSpeechNativeCaptureRouteWorkflowIssue::IsStructurallyValid() const +{ + return !IssueId.IsEmpty() + && !IssueKind.IsEmpty() + && !StatusLine.IsEmpty() + && !DetailLine.IsEmpty() + && !RecommendedActionId.IsEmpty(); +} + +bool FHyperTwistSpeechNativeCaptureRouteWorkflowState::IsStructurallyValid() const +{ + if (NativeCaptureRouteWorkflowProfileId.IsEmpty() + || WorkflowStateId.IsEmpty() + || CaptureRouteStateId.IsEmpty() + || PermissionStateId.IsEmpty() + || ActiveProviderProfileId.IsEmpty() + || ActiveServiceLaneId.IsEmpty() + || LatestSourceKind.IsEmpty() + || StatusLine.IsEmpty() + || DetailLine.IsEmpty() + || WorkflowEntryCount < 0 + || PreparationEntryCount < 0 + || RouteRetryEntryCount < 0 + || SessionReopenEntryCount < 0 + || PermissionDependencyEntryCount < 0 + || ActiveIssueCount < 0 + || AvailableActionIds.Num() <= 0) + { + return false; + } + + if (WorkflowEntryCount != Entries.Num() + || ActiveIssueCount != Issues.Num() + || PreparationEntryCount > WorkflowEntryCount + || RouteRetryEntryCount > WorkflowEntryCount + || SessionReopenEntryCount > WorkflowEntryCount + || PermissionDependencyEntryCount > WorkflowEntryCount) + { + return false; + } + + return (ActiveIssueCount <= 0 || ActiveIssue.IsStructurallyValid()) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(Entries) + && HyperTwistRecognitionTypesInternal::AreAllItemsStructurallyValid(Issues) + && HyperTwistRecognitionTypesInternal::AreAllStringsPopulated(AvailableActionIds); +} diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistSkills/HyperTwistSkillCoreLibrary.cpp b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistSkills/HyperTwistSkillCoreLibrary.cpp index 35a56b5..bfe7a2b 100644 --- a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistSkills/HyperTwistSkillCoreLibrary.cpp +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistSkills/HyperTwistSkillCoreLibrary.cpp @@ -3647,6 +3647,11 @@ UHyperTwistSkillCoreLibrary::DeriveSkillContinuityResumeState( } else if (SkillId == TEXT("skill/capture-note")) { + const bool bCanCaptureNotesNow = + KnowledgeNotesState.bUserNotesLaneAvailable + && !KnowledgeNotesState.UserNotesPosture.bRequiresSeparateOwnerActivation + && Entry->Status == EHyperTwistSkillStatus::ImplementedNow; + SkillState.InputStateKinds = { TEXT("state/memory-knowledge-notes"), TEXT("state/memory-user-notes-posture") @@ -3660,14 +3665,13 @@ UHyperTwistSkillCoreLibrary::DeriveSkillContinuityResumeState( KnowledgeNotesState.UserNotesPosture.SummaryLine ); - SkillState.AvailableItemCount = - KnowledgeNotesState.bUserNotesLaneAvailable ? 1 : 0; + SkillState.AvailableItemCount = bCanCaptureNotesNow ? 1 : 0; SkillState.BlockingItemCount = KnowledgeNotesState.UserNotesPosture.bRequiresSeparateOwnerActivation ? 1 : 0; SkillState.bLiveSkill = false; SkillState.bReadsAuthoritativeStores = KnowledgeNotesState.UserNotesPosture.bOwnershipJustified; - SkillState.bAvailableNow = KnowledgeNotesState.bUserNotesLaneAvailable; + SkillState.bAvailableNow = bCanCaptureNotesNow; SkillState.bRequiresOwnerActivation = KnowledgeNotesState.UserNotesPosture.bRequiresSeparateOwnerActivation; SkillState.Summary = diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistSkills/HyperTwistSkillTypes.cpp b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistSkills/HyperTwistSkillTypes.cpp new file mode 100644 index 0000000..2de2a70 --- /dev/null +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistSkills/HyperTwistSkillTypes.cpp @@ -0,0 +1,1944 @@ +#include "HyperTwistSkills/HyperTwistSkillTypes.h" + +namespace HyperTwistSkillTypesInternal +{ + bool AreAllStringsPopulated(const TArray& Values) + { + for (const FString& Value : Values) + { + if (Value.IsEmpty()) + { + return false; + } + } + + return true; + } +} + +bool FHyperTwistSkillExtractionSkill::IsStructurallyValid() const +{ + if (SkillId.IsEmpty() + || DisplayLabel.IsEmpty() + || CommandSurfaceId.IsEmpty() + || ServiceBindingId.IsEmpty() + || OwnerLaneId.IsEmpty() + || OwnerFeatureId.IsEmpty() + || Status == EHyperTwistSkillStatus::None + || PermissionScopeIds.Num() == 0 + || SourceSurfaceIds.Num() == 0 + || StructuredFieldIds.Num() == 0 + || OutputArtifactKinds.Num() == 0 + || PreviewHeadlines.Num() == 0 + || SourceSurfaceCount != SourceSurfaceIds.Num() + || StructuredFieldCount != StructuredFieldIds.Num() + || !bReadsAuthoritativeSourceSurfaces + || !bPreservesOptionalAssistiveOffState + || !bDerivedAssistiveOnly + || !bHasValidationHarnessCoverage + || !bStructuredExtractionOnly + || !bAvoidsBrowserDiagnosticsWidening + || !bAvoidsDesignTranslationWidening + || bExtractsDocumentation == bExtractsDesignSpecs) + { + return false; + } + + if (!HyperTwistSkillTypesInternal::AreAllStringsPopulated(PermissionScopeIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(SourceSurfaceIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(StructuredFieldIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(OutputArtifactKinds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(PreviewHeadlines)) + { + return false; + } + + return Status == EHyperTwistSkillStatus::ImplementedNow + && bLiveSkill + && bAvailableNow + && !bRequiresOwnerActivation; +} + +bool FHyperTwistSkillExtractionState::IsStructurallyValid() const +{ + if (RegistryId.IsEmpty() + || ManifestVersion.IsEmpty() + || ReferenceUtc.IsEmpty() + || CommandSurfaceRootId.IsEmpty() + || TemplateVersion.IsEmpty() + || Skills.Num() == 0 + || SkillCount != Skills.Num() + || !bEveryLiveSkillReadsAuthoritativeSourceSurfaces + || !bEverySkillPreservesOptionalAssistiveOffState + || !bEveryLiveSkillHasValidationHarnessCoverage + || !bStructuredExtractionRemainsBounded + || !bNoBrowserDiagnosticsWidening + || !bNoDesignTranslationWidening) + { + return false; + } + + TArray SeenSkillIds; + int32 ComputedLiveSkillCount = 0; + int32 ComputedAvailableNowCount = 0; + int32 ComputedDocsExtractionSkillCount = 0; + int32 ComputedDesignSpecExtractionSkillCount = 0; + bool bComputedEveryLiveSkillReadsAuthoritativeSourceSurfaces = true; + bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; + bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; + bool bComputedStructuredExtractionBounded = true; + bool bComputedNoBrowserDiagnosticsWidening = true; + bool bComputedNoDesignTranslationWidening = true; + + for (const FHyperTwistSkillExtractionSkill& Skill : Skills) + { + if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) + { + return false; + } + + SeenSkillIds.Add(Skill.SkillId); + ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; + ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; + ComputedDocsExtractionSkillCount += Skill.bExtractsDocumentation ? 1 : 0; + ComputedDesignSpecExtractionSkillCount += Skill.bExtractsDesignSpecs ? 1 : 0; + bComputedEverySkillPreservesOptionalAssistiveOffState &= + Skill.bPreservesOptionalAssistiveOffState; + bComputedStructuredExtractionBounded &= Skill.bStructuredExtractionOnly; + bComputedNoBrowserDiagnosticsWidening &= Skill.bAvoidsBrowserDiagnosticsWidening; + bComputedNoDesignTranslationWidening &= Skill.bAvoidsDesignTranslationWidening; + + if (Skill.bLiveSkill) + { + bComputedEveryLiveSkillReadsAuthoritativeSourceSurfaces &= + Skill.bReadsAuthoritativeSourceSurfaces; + bComputedEveryLiveSkillHasValidationHarnessCoverage &= + Skill.bHasValidationHarnessCoverage; + } + } + + return LiveSkillCount == ComputedLiveSkillCount + && AvailableNowCount == ComputedAvailableNowCount + && DocsExtractionSkillCount == ComputedDocsExtractionSkillCount + && DesignSpecExtractionSkillCount == ComputedDesignSpecExtractionSkillCount + && bEveryLiveSkillReadsAuthoritativeSourceSurfaces + == bComputedEveryLiveSkillReadsAuthoritativeSourceSurfaces + && bEverySkillPreservesOptionalAssistiveOffState + == bComputedEverySkillPreservesOptionalAssistiveOffState + && bEveryLiveSkillHasValidationHarnessCoverage + == bComputedEveryLiveSkillHasValidationHarnessCoverage + && bStructuredExtractionRemainsBounded == bComputedStructuredExtractionBounded + && bNoBrowserDiagnosticsWidening == bComputedNoBrowserDiagnosticsWidening + && bNoDesignTranslationWidening == bComputedNoDesignTranslationWidening; +} + +bool FHyperTwistSkillBrowserDiagnosticSkill::IsStructurallyValid() const +{ + if (SkillId.IsEmpty() + || DisplayLabel.IsEmpty() + || CommandSurfaceId.IsEmpty() + || ServiceBindingId.IsEmpty() + || OwnerLaneId.IsEmpty() + || OwnerFeatureId.IsEmpty() + || Status == EHyperTwistSkillStatus::None + || PermissionScopeIds.Num() == 0 + || SourceSurfaceIds.Num() == 0 + || RequiredExtractionSkillIds.Num() == 0 + || OutputArtifactKinds.Num() == 0 + || PreviewHeadlines.Num() == 0 + || SourceSurfaceCount != SourceSurfaceIds.Num() + || RequiredExtractionSkillCount != RequiredExtractionSkillIds.Num() + || !bReadsAuthoritativeBrowserAndDocSurfaces + || !bPreservesOptionalAssistiveOffState + || !bDerivedAssistiveOnly + || !bHasValidationHarnessCoverage + || !bBoundedToDiagnosticsOnly + || !bRequiresExtractionSubstrate + || !bAvoidsDesignTranslationWidening + || bCapturesBrowserTrace == bPerformsBrowserApiDiscovery) + { + return false; + } + + if (!HyperTwistSkillTypesInternal::AreAllStringsPopulated(PermissionScopeIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(SourceSurfaceIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(RequiredExtractionSkillIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(OutputArtifactKinds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(PreviewHeadlines)) + { + return false; + } + + return Status == EHyperTwistSkillStatus::ImplementedNow + && bLiveSkill + && bAvailableNow + && !bRequiresOwnerActivation; +} + +bool FHyperTwistSkillBrowserDiagnosticsState::IsStructurallyValid() const +{ + if (RegistryId.IsEmpty() + || ManifestVersion.IsEmpty() + || ReferenceUtc.IsEmpty() + || CommandSurfaceRootId.IsEmpty() + || TemplateVersion.IsEmpty() + || Skills.Num() == 0 + || SkillCount != Skills.Num() + || !bEveryLiveSkillReadsAuthoritativeBrowserAndDocSurfaces + || !bEverySkillPreservesOptionalAssistiveOffState + || !bEveryLiveSkillHasValidationHarnessCoverage + || !bDiagnosticsRemainBounded + || !bEverySkillRequiresExtractionSubstrate + || !bNoDesignTranslationWidening) + { + return false; + } + + TArray SeenSkillIds; + int32 ComputedLiveSkillCount = 0; + int32 ComputedAvailableNowCount = 0; + int32 ComputedBrowserTraceCaptureSkillCount = 0; + int32 ComputedBrowserApiDiscoverySkillCount = 0; + bool bComputedEveryLiveSkillReadsAuthoritativeBrowserAndDocSurfaces = true; + bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; + bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; + bool bComputedDiagnosticsRemainBounded = true; + bool bComputedEverySkillRequiresExtractionSubstrate = true; + bool bComputedNoDesignTranslationWidening = true; + + for (const FHyperTwistSkillBrowserDiagnosticSkill& Skill : Skills) + { + if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) + { + return false; + } + + SeenSkillIds.Add(Skill.SkillId); + ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; + ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; + ComputedBrowserTraceCaptureSkillCount += Skill.bCapturesBrowserTrace ? 1 : 0; + ComputedBrowserApiDiscoverySkillCount += Skill.bPerformsBrowserApiDiscovery ? 1 : 0; + bComputedEverySkillPreservesOptionalAssistiveOffState &= + Skill.bPreservesOptionalAssistiveOffState; + bComputedDiagnosticsRemainBounded &= Skill.bBoundedToDiagnosticsOnly; + bComputedEverySkillRequiresExtractionSubstrate &= Skill.bRequiresExtractionSubstrate; + bComputedNoDesignTranslationWidening &= Skill.bAvoidsDesignTranslationWidening; + + if (Skill.bLiveSkill) + { + bComputedEveryLiveSkillReadsAuthoritativeBrowserAndDocSurfaces &= + Skill.bReadsAuthoritativeBrowserAndDocSurfaces; + bComputedEveryLiveSkillHasValidationHarnessCoverage &= + Skill.bHasValidationHarnessCoverage; + } + } + + return LiveSkillCount == ComputedLiveSkillCount + && AvailableNowCount == ComputedAvailableNowCount + && BrowserTraceCaptureSkillCount == ComputedBrowserTraceCaptureSkillCount + && BrowserApiDiscoverySkillCount == ComputedBrowserApiDiscoverySkillCount + && bEveryLiveSkillReadsAuthoritativeBrowserAndDocSurfaces + == bComputedEveryLiveSkillReadsAuthoritativeBrowserAndDocSurfaces + && bEverySkillPreservesOptionalAssistiveOffState + == bComputedEverySkillPreservesOptionalAssistiveOffState + && bEveryLiveSkillHasValidationHarnessCoverage + == bComputedEveryLiveSkillHasValidationHarnessCoverage + && bDiagnosticsRemainBounded == bComputedDiagnosticsRemainBounded + && bEverySkillRequiresExtractionSubstrate + == bComputedEverySkillRequiresExtractionSubstrate + && bNoDesignTranslationWidening == bComputedNoDesignTranslationWidening; +} + +bool FHyperTwistSkillDesignShellSkill::IsStructurallyValid() const +{ + if (SkillId.IsEmpty() + || DisplayLabel.IsEmpty() + || CommandSurfaceId.IsEmpty() + || ServiceBindingId.IsEmpty() + || OwnerLaneId.IsEmpty() + || OwnerFeatureId.IsEmpty() + || Status == EHyperTwistSkillStatus::None + || PermissionScopeIds.Num() == 0 + || SourceSurfaceIds.Num() == 0 + || RequiredExtractionSkillIds.Num() == 0 + || RequiredBrowserDiagnosticSkillIds.Num() == 0 + || OutputArtifactKinds.Num() == 0 + || PreviewHeadlines.Num() == 0 + || SourceSurfaceCount != SourceSurfaceIds.Num() + || RequiredExtractionSkillCount != RequiredExtractionSkillIds.Num() + || RequiredBrowserDiagnosticSkillCount != RequiredBrowserDiagnosticSkillIds.Num() + || !bReadsAuthoritativeDocsBrowserAndDesignSurfaces + || !bPreservesOptionalAssistiveOffState + || !bDerivedAssistiveOnly + || !bHasValidationHarnessCoverage + || !bBoundedToDesignShellOnly + || !bRequiresExtractionSubstrate + || !bRequiresBrowserDiagnosticsSubstrate + || !bAvoidsGenericBrowserShellWidening + || bTranslatesDesignShell == bTranslatesInteractionContract) + { + return false; + } + + if (!HyperTwistSkillTypesInternal::AreAllStringsPopulated(PermissionScopeIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(SourceSurfaceIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(RequiredExtractionSkillIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(RequiredBrowserDiagnosticSkillIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(OutputArtifactKinds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(PreviewHeadlines)) + { + return false; + } + + return Status == EHyperTwistSkillStatus::ImplementedNow + && bLiveSkill + && bAvailableNow + && !bRequiresOwnerActivation; +} + +bool FHyperTwistSkillDesignShellState::IsStructurallyValid() const +{ + if (RegistryId.IsEmpty() + || ManifestVersion.IsEmpty() + || ReferenceUtc.IsEmpty() + || CommandSurfaceRootId.IsEmpty() + || TemplateVersion.IsEmpty() + || Skills.Num() == 0 + || SkillCount != Skills.Num() + || !bEveryLiveSkillReadsAuthoritativeDocsBrowserAndDesignSurfaces + || !bEverySkillPreservesOptionalAssistiveOffState + || !bEveryLiveSkillHasValidationHarnessCoverage + || !bDesignShellTranslationRemainsBounded + || !bEverySkillRequiresExtractionSubstrate + || !bEverySkillRequiresBrowserDiagnosticsSubstrate + || !bNoGenericBrowserShellWidening) + { + return false; + } + + TArray SeenSkillIds; + int32 ComputedLiveSkillCount = 0; + int32 ComputedAvailableNowCount = 0; + int32 ComputedDesignShellTranslationSkillCount = 0; + int32 ComputedInteractionContractTranslationSkillCount = 0; + bool bComputedEveryLiveSkillReadsAuthoritativeDocsBrowserAndDesignSurfaces = true; + bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; + bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; + bool bComputedDesignShellTranslationRemainsBounded = true; + bool bComputedEverySkillRequiresExtractionSubstrate = true; + bool bComputedEverySkillRequiresBrowserDiagnosticsSubstrate = true; + bool bComputedNoGenericBrowserShellWidening = true; + + for (const FHyperTwistSkillDesignShellSkill& Skill : Skills) + { + if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) + { + return false; + } + + SeenSkillIds.Add(Skill.SkillId); + ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; + ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; + ComputedDesignShellTranslationSkillCount += Skill.bTranslatesDesignShell ? 1 : 0; + ComputedInteractionContractTranslationSkillCount += + Skill.bTranslatesInteractionContract ? 1 : 0; + bComputedEverySkillPreservesOptionalAssistiveOffState &= + Skill.bPreservesOptionalAssistiveOffState; + bComputedDesignShellTranslationRemainsBounded &= Skill.bBoundedToDesignShellOnly; + bComputedEverySkillRequiresExtractionSubstrate &= Skill.bRequiresExtractionSubstrate; + bComputedEverySkillRequiresBrowserDiagnosticsSubstrate &= + Skill.bRequiresBrowserDiagnosticsSubstrate; + bComputedNoGenericBrowserShellWidening &= + Skill.bAvoidsGenericBrowserShellWidening; + + if (Skill.bLiveSkill) + { + bComputedEveryLiveSkillReadsAuthoritativeDocsBrowserAndDesignSurfaces &= + Skill.bReadsAuthoritativeDocsBrowserAndDesignSurfaces; + bComputedEveryLiveSkillHasValidationHarnessCoverage &= + Skill.bHasValidationHarnessCoverage; + } + } + + return LiveSkillCount == ComputedLiveSkillCount + && AvailableNowCount == ComputedAvailableNowCount + && DesignShellTranslationSkillCount == ComputedDesignShellTranslationSkillCount + && InteractionContractTranslationSkillCount + == ComputedInteractionContractTranslationSkillCount + && bEveryLiveSkillReadsAuthoritativeDocsBrowserAndDesignSurfaces + == bComputedEveryLiveSkillReadsAuthoritativeDocsBrowserAndDesignSurfaces + && bEverySkillPreservesOptionalAssistiveOffState + == bComputedEverySkillPreservesOptionalAssistiveOffState + && bEveryLiveSkillHasValidationHarnessCoverage + == bComputedEveryLiveSkillHasValidationHarnessCoverage + && bDesignShellTranslationRemainsBounded + == bComputedDesignShellTranslationRemainsBounded + && bEverySkillRequiresExtractionSubstrate + == bComputedEverySkillRequiresExtractionSubstrate + && bEverySkillRequiresBrowserDiagnosticsSubstrate + == bComputedEverySkillRequiresBrowserDiagnosticsSubstrate + && bNoGenericBrowserShellWidening == bComputedNoGenericBrowserShellWidening; +} + +bool FHyperTwistSkillRegistryState::IsStructurallyValid() const +{ + if (RegistryId.IsEmpty() + || ManifestVersion.IsEmpty() + || ReferenceUtc.IsEmpty() + || CommandSurfaceRootId.IsEmpty() + || Entries.Num() == 0 + || SkillCount != Entries.Num() + || !bAllSkillsOptionalAssistive + || !bDisabledSkillsRemainInstalled + || !bDisabledSkillsAreInert + || !bNoAdHocMetadataRequired) + { + return false; + } + + TArray SeenSkillIds; + int32 ComputedEnabledByDefaultCount = 0; + bool bComputedAllOptionalAssistive = true; + bool bComputedDisabledRemainInstalled = true; + bool bComputedDisabledAreInert = true; + + for (const FHyperTwistSkillManifestEntry& Entry : Entries) + { + if (!Entry.IsStructurallyValid() || SeenSkillIds.Contains(Entry.SkillId)) + { + return false; + } + + SeenSkillIds.Add(Entry.SkillId); + ComputedEnabledByDefaultCount += Entry.bEnabledByDefault ? 1 : 0; + bComputedAllOptionalAssistive &= Entry.bOptionalAssistive; + bComputedDisabledRemainInstalled &= Entry.bInstalledWhenDisabled; + bComputedDisabledAreInert &= Entry.bInertWhenDisabled; + } + + if (EnabledByDefaultCount != ComputedEnabledByDefaultCount + || DisabledByDefaultCount != (Entries.Num() - ComputedEnabledByDefaultCount) + || bAllSkillsOptionalAssistive != bComputedAllOptionalAssistive + || bDisabledSkillsRemainInstalled != bComputedDisabledRemainInstalled + || bDisabledSkillsAreInert != bComputedDisabledAreInert) + { + return false; + } + + TArray SeenStatuses; + for (const FHyperTwistSkillStatusCount& StatusCount : StatusCounts) + { + if (!StatusCount.IsStructurallyValid() || SeenStatuses.Contains(StatusCount.Status)) + { + return false; + } + + int32 ComputedCount = 0; + for (const FHyperTwistSkillManifestEntry& Entry : Entries) + { + ComputedCount += Entry.Status == StatusCount.Status ? 1 : 0; + } + + if (ComputedCount != StatusCount.Count) + { + return false; + } + + SeenStatuses.Add(StatusCount.Status); + } + + TArray SeenFamilies; + for (const FHyperTwistSkillFamilyCount& FamilyCount : FamilyCounts) + { + if (!FamilyCount.IsStructurallyValid() || SeenFamilies.Contains(FamilyCount.Family)) + { + return false; + } + + int32 ComputedCount = 0; + for (const FHyperTwistSkillManifestEntry& Entry : Entries) + { + ComputedCount += Entry.Family == FamilyCount.Family ? 1 : 0; + } + + if (ComputedCount != FamilyCount.Count) + { + return false; + } + + SeenFamilies.Add(FamilyCount.Family); + } + + return true; +} + +bool FHyperTwistSkillControlState::IsStructurallyValid() const +{ + if (RegistryId.IsEmpty() + || ManifestVersion.IsEmpty() + || ReferenceUtc.IsEmpty() + || CommandSurfaceRootId.IsEmpty() + || ControlProfileId.IsEmpty() + || !MasterSwitch.IsStructurallyValid() + || SkillStates.Num() == 0 + || SkillCount != SkillStates.Num() + || EffectiveDisabledSkillCount != (SkillCount - EffectiveEnabledSkillCount) + || HiddenSkillCount != (SkillCount - VisibleSkillCount) + || !bCoreProductWorksWithAllSkillsOff + || !bNoPromptBabysittingToDisable + || !bAllInstalledSkillsRemainReenableable) + { + return false; + } + + TArray SeenSkillIds; + int32 ComputedEnabledCount = 0; + int32 ComputedVisibleCount = 0; + bool bComputedNoBabysitting = true; + bool bComputedReenableable = true; + for (const FHyperTwistSkillControlStateEntry& SkillState : SkillStates) + { + if (!SkillState.IsStructurallyValid() || SeenSkillIds.Contains(SkillState.SkillId)) + { + return false; + } + + SeenSkillIds.Add(SkillState.SkillId); + ComputedEnabledCount += SkillState.bEffectiveEnabled ? 1 : 0; + ComputedVisibleCount += SkillState.bEffectiveVisible ? 1 : 0; + bComputedNoBabysitting &= SkillState.bDurableSettingExposed; + bComputedReenableable &= SkillState.bInstalled && SkillState.bInertWhenDisabled; + } + + if (ComputedEnabledCount != EffectiveEnabledSkillCount + || ComputedVisibleCount != VisibleSkillCount + || bComputedNoBabysitting != bNoPromptBabysittingToDisable + || bComputedReenableable != bAllInstalledSkillsRemainReenableable) + { + return false; + } + + TArray SeenGroupIds; + for (const FHyperTwistSkillVisibilityGroupState& Group : VisibilityGroups) + { + if (!Group.IsStructurallyValid() || SeenGroupIds.Contains(Group.GroupId)) + { + return false; + } + + int32 ComputedGroupVisibleCount = 0; + int32 ComputedGroupHiddenCount = 0; + for (const FString& SkillId : Group.SkillIds) + { + const FHyperTwistSkillControlStateEntry* SkillState = SkillStates.FindByPredicate( + [&SkillId](const FHyperTwistSkillControlStateEntry& Entry) + { + return Entry.SkillId == SkillId; + } + ); + if (SkillState == nullptr + || SkillState->Family != Group.Family + || SkillState->VisibilityGroupId != Group.GroupId) + { + return false; + } + + ComputedGroupVisibleCount += SkillState->bEffectiveVisible ? 1 : 0; + ComputedGroupHiddenCount += SkillState->bEffectiveVisible ? 0 : 1; + } + + if (ComputedGroupVisibleCount != Group.VisibleSkillCount + || ComputedGroupHiddenCount != Group.HiddenSkillCount) + { + return false; + } + + SeenGroupIds.Add(Group.GroupId); + } + + return true; +} + +bool FHyperTwistSkillAuditLedgerState::IsStructurallyValid() const +{ + if (RegistryId.IsEmpty() + || ManifestVersion.IsEmpty() + || ReferenceUtc.IsEmpty() + || CommandSurfaceRootId.IsEmpty() + || ControlProfileId.IsEmpty() + || LedgerId.IsEmpty() + || InvocationCount != InvocationRecords.Num() + || EnabledSkillCount < 0 + || InvocationCount < 0 + || SuccessfulInvocationCount < 0 + || FailedInvocationCount < 0 + || CancelledInvocationCount < 0 + || TraceableInvocationCount < 0 + || ProductTruthOutputCount < 0 + || TraceableProductTruthOutputCount < 0 + || !bNoUntraceableProductTruth + || !bCommandServiceProvenanceVisible) + { + return false; + } + + TArray SeenInvocationIds; + int32 ComputedSuccessCount = 0; + int32 ComputedFailureCount = 0; + int32 ComputedCancelCount = 0; + int32 ComputedTraceableInvocationCount = 0; + int32 ComputedProductTruthCount = 0; + int32 ComputedTraceableProductTruthCount = 0; + bool bComputedCommandProvenanceVisible = true; + for (const FHyperTwistSkillInvocationRecord& Record : InvocationRecords) + { + if (!Record.IsStructurallyValid() || SeenInvocationIds.Contains(Record.InvocationId)) + { + return false; + } + + SeenInvocationIds.Add(Record.InvocationId); + ComputedTraceableInvocationCount += Record.bInvocationTraceable ? 1 : 0; + ComputedProductTruthCount += Record.bOutputBecameProductTruth ? 1 : 0; + ComputedTraceableProductTruthCount += + (Record.bOutputBecameProductTruth && Record.bOutputTraceable) ? 1 : 0; + bComputedCommandProvenanceVisible &= Record.CommandProvenance.bCommandBindingDeclared + && Record.CommandProvenance.bServiceBindingVisible; + + switch (Record.Outcome) + { + case EHyperTwistSkillInvocationOutcome::Succeeded: + ComputedSuccessCount += 1; + break; + + case EHyperTwistSkillInvocationOutcome::Failed: + ComputedFailureCount += 1; + break; + + case EHyperTwistSkillInvocationOutcome::Cancelled: + ComputedCancelCount += 1; + break; + + default: + return false; + } + } + + return SuccessfulInvocationCount == ComputedSuccessCount + && FailedInvocationCount == ComputedFailureCount + && CancelledInvocationCount == ComputedCancelCount + && TraceableInvocationCount == ComputedTraceableInvocationCount + && ProductTruthOutputCount == ComputedProductTruthCount + && TraceableProductTruthOutputCount == ComputedTraceableProductTruthCount + && bNoUntraceableProductTruth + == (ComputedProductTruthCount == ComputedTraceableProductTruthCount) + && bFailureRecordingSupported + && bCancelRecordingSupported + && bCommandServiceProvenanceVisible == bComputedCommandProvenanceVisible; +} + +bool FHyperTwistSkillAuthoringHarnessState::IsStructurallyValid() const +{ + if (RegistryId.IsEmpty() + || ManifestVersion.IsEmpty() + || ReferenceUtc.IsEmpty() + || CommandSurfaceRootId.IsEmpty() + || AuditLedgerId.IsEmpty() + || TemplateVersion.IsEmpty() + || TemplateSections.Num() == 0 + || Examples.Num() == 0 + || ValidationCases.Num() == 0 + || SkillCount <= 0 + || ExampleCount != Examples.Num() + || ValidationCaseCount != ValidationCases.Num() + || SkillsWithSmokeContractCount < 0 + || SkillsWithEvalContractCount < 0 + || !bNewSkillsCanBeAddedWithoutInventingStructure + || !bEverySkillHasSmokeContract + || !bEverySkillHasEvalContract + || !bExamplesGroundedInFirstPartyRegistry + || !bValidationHarnessUsesAuditLedgerWhenLive) + { + return false; + } + + TArray SeenSectionIds; + for (const FHyperTwistSkillAuthoringTemplateSection& Section : TemplateSections) + { + if (!Section.IsStructurallyValid() || SeenSectionIds.Contains(Section.SectionId)) + { + return false; + } + + SeenSectionIds.Add(Section.SectionId); + } + + TArray SeenExampleIds; + TArray ExampleSkillIds; + bool bComputedExamplesGroundedInRegistry = true; + for (const FHyperTwistSkillAuthoringExampleState& Example : Examples) + { + if (!Example.IsStructurallyValid() || SeenExampleIds.Contains(Example.ExampleId)) + { + return false; + } + + for (const FString& SectionId : Example.TemplateSectionIds) + { + if (!SeenSectionIds.Contains(SectionId)) + { + return false; + } + } + + SeenExampleIds.Add(Example.ExampleId); + ExampleSkillIds.Add(Example.SkillId); + bComputedExamplesGroundedInRegistry &= Example.bGroundedInRegistry; + } + + TArray SeenCaseIds; + TArray SkillsWithSmokeContract; + TArray SkillsWithEvalContract; + bool bComputedValidationUsesAuditLedgerWhenLive = true; + for (const FHyperTwistSkillValidationContractCase& ValidationCase : ValidationCases) + { + if (!ValidationCase.IsStructurallyValid() || SeenCaseIds.Contains(ValidationCase.CaseId)) + { + return false; + } + + if (!ExampleSkillIds.Contains(ValidationCase.SkillId)) + { + return false; + } + + for (const FString& SectionId : ValidationCase.RequiredTemplateSectionIds) + { + if (!SeenSectionIds.Contains(SectionId)) + { + return false; + } + } + + if (ValidationCase.Kind == EHyperTwistSkillValidationContractKind::Smoke) + { + SkillsWithSmokeContract.AddUnique(ValidationCase.SkillId); + } + else if (ValidationCase.Kind == EHyperTwistSkillValidationContractKind::Eval) + { + SkillsWithEvalContract.AddUnique(ValidationCase.SkillId); + } + + bComputedValidationUsesAuditLedgerWhenLive &= + ValidationCase.ExecutionMode != EHyperTwistSkillValidationExecutionMode::LiveContract + || ValidationCase.bUsesAuditLedgerEvidence; + + SeenCaseIds.Add(ValidationCase.CaseId); + } + + return SkillsWithSmokeContractCount == SkillsWithSmokeContract.Num() + && SkillsWithEvalContractCount == SkillsWithEvalContract.Num() + && SkillsWithSmokeContractCount == SkillCount + && SkillsWithEvalContractCount == SkillCount + && bExamplesGroundedInFirstPartyRegistry == bComputedExamplesGroundedInRegistry + && bValidationHarnessUsesAuditLedgerWhenLive + == bComputedValidationUsesAuditLedgerWhenLive; +} + +bool FHyperTwistSkillWorkflowReviewSkill::IsStructurallyValid() const +{ + if (SkillId.IsEmpty() + || DisplayLabel.IsEmpty() + || CommandSurfaceId.IsEmpty() + || ServiceBindingId.IsEmpty() + || OwnerLaneId.IsEmpty() + || OwnerFeatureId.IsEmpty() + || Status == EHyperTwistSkillStatus::None + || PermissionScopeIds.Num() == 0 + || SourceSurfaceIds.Num() == 0 + || RequiredExtractionSkillIds.Num() == 0 + || RequiredWorkflowMemorySkillIds.Num() == 0 + || RequiredDesignShellSkillIds.Num() == 0 + || OutputArtifactKinds.Num() == 0 + || PreviewHeadlines.Num() == 0 + || SourceSurfaceCount != SourceSurfaceIds.Num() + || RequiredExtractionSkillCount != RequiredExtractionSkillIds.Num() + || RequiredWorkflowMemorySkillCount != RequiredWorkflowMemorySkillIds.Num() + || RequiredDesignShellSkillCount != RequiredDesignShellSkillIds.Num() + || !bReadsAuthoritativeWorkflowAndReviewSurfaces + || !bPreservesOptionalAssistiveOffState + || !bDerivedAssistiveOnly + || !bHasValidationHarnessCoverage + || !bBoundedToWorkflowReviewOnly + || !bRequiresExtractionSubstrate + || !bRequiresWorkflowMemorySubstrate + || !bRequiresDesignShellSubstrate + || !bAvoidsImplementationReviewDelegationWidening + || !bAvoidsPlanSynthesisWidening) + { + return false; + } + + if (!HyperTwistSkillTypesInternal::AreAllStringsPopulated(PermissionScopeIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(SourceSurfaceIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(RequiredExtractionSkillIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(RequiredWorkflowMemorySkillIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(RequiredDesignShellSkillIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(OutputArtifactKinds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(PreviewHeadlines)) + { + return false; + } + + const int32 ReviewModeCount = + (bReviewsProposal ? 1 : 0) + (bReviewsDiff ? 1 : 0) + (bWrapsBoundedWorkflow ? 1 : 0); + return ReviewModeCount == 1 + && Status == EHyperTwistSkillStatus::ImplementedNow + && bLiveSkill + && bAvailableNow + && !bRequiresOwnerActivation; +} + +bool FHyperTwistSkillWorkflowReviewState::IsStructurallyValid() const +{ + if (RegistryId.IsEmpty() + || ManifestVersion.IsEmpty() + || ReferenceUtc.IsEmpty() + || CommandSurfaceRootId.IsEmpty() + || TemplateVersion.IsEmpty() + || Skills.Num() == 0 + || SkillCount != Skills.Num() + || !bEveryLiveSkillReadsAuthoritativeWorkflowAndReviewSurfaces + || !bEverySkillPreservesOptionalAssistiveOffState + || !bEveryLiveSkillHasValidationHarnessCoverage + || !bWorkflowReviewRemainsBounded + || !bEverySkillRequiresExtractionSubstrate + || !bEverySkillRequiresWorkflowMemorySubstrate + || !bEverySkillRequiresDesignShellSubstrate + || !bNoImplementationReviewDelegationWidening + || !bNoPlanSynthesisWidening) + { + return false; + } + + TArray SeenSkillIds; + int32 ComputedLiveSkillCount = 0; + int32 ComputedAvailableNowCount = 0; + int32 ComputedProposalReviewSkillCount = 0; + int32 ComputedDiffReviewSkillCount = 0; + int32 ComputedBoundedWorkflowWrapperSkillCount = 0; + bool bComputedEveryLiveSkillReadsAuthoritativeWorkflowAndReviewSurfaces = true; + bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; + bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; + bool bComputedWorkflowReviewRemainsBounded = true; + bool bComputedEverySkillRequiresExtractionSubstrate = true; + bool bComputedEverySkillRequiresWorkflowMemorySubstrate = true; + bool bComputedEverySkillRequiresDesignShellSubstrate = true; + bool bComputedNoImplementationReviewDelegationWidening = true; + bool bComputedNoPlanSynthesisWidening = true; + + for (const FHyperTwistSkillWorkflowReviewSkill& Skill : Skills) + { + if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) + { + return false; + } + + SeenSkillIds.Add(Skill.SkillId); + ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; + ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; + ComputedProposalReviewSkillCount += Skill.bReviewsProposal ? 1 : 0; + ComputedDiffReviewSkillCount += Skill.bReviewsDiff ? 1 : 0; + ComputedBoundedWorkflowWrapperSkillCount += Skill.bWrapsBoundedWorkflow ? 1 : 0; + bComputedEverySkillPreservesOptionalAssistiveOffState &= + Skill.bPreservesOptionalAssistiveOffState; + bComputedWorkflowReviewRemainsBounded &= Skill.bBoundedToWorkflowReviewOnly; + bComputedEverySkillRequiresExtractionSubstrate &= Skill.bRequiresExtractionSubstrate; + bComputedEverySkillRequiresWorkflowMemorySubstrate &= + Skill.bRequiresWorkflowMemorySubstrate; + bComputedEverySkillRequiresDesignShellSubstrate &= + Skill.bRequiresDesignShellSubstrate; + bComputedNoImplementationReviewDelegationWidening &= + Skill.bAvoidsImplementationReviewDelegationWidening; + bComputedNoPlanSynthesisWidening &= Skill.bAvoidsPlanSynthesisWidening; + + if (Skill.bLiveSkill) + { + bComputedEveryLiveSkillReadsAuthoritativeWorkflowAndReviewSurfaces &= + Skill.bReadsAuthoritativeWorkflowAndReviewSurfaces; + bComputedEveryLiveSkillHasValidationHarnessCoverage &= + Skill.bHasValidationHarnessCoverage; + } + } + + return LiveSkillCount == ComputedLiveSkillCount + && AvailableNowCount == ComputedAvailableNowCount + && ProposalReviewSkillCount == ComputedProposalReviewSkillCount + && DiffReviewSkillCount == ComputedDiffReviewSkillCount + && BoundedWorkflowWrapperSkillCount == ComputedBoundedWorkflowWrapperSkillCount + && bEveryLiveSkillReadsAuthoritativeWorkflowAndReviewSurfaces + == bComputedEveryLiveSkillReadsAuthoritativeWorkflowAndReviewSurfaces + && bEverySkillPreservesOptionalAssistiveOffState + == bComputedEverySkillPreservesOptionalAssistiveOffState + && bEveryLiveSkillHasValidationHarnessCoverage + == bComputedEveryLiveSkillHasValidationHarnessCoverage + && bWorkflowReviewRemainsBounded == bComputedWorkflowReviewRemainsBounded + && bEverySkillRequiresExtractionSubstrate + == bComputedEverySkillRequiresExtractionSubstrate + && bEverySkillRequiresWorkflowMemorySubstrate + == bComputedEverySkillRequiresWorkflowMemorySubstrate + && bEverySkillRequiresDesignShellSubstrate + == bComputedEverySkillRequiresDesignShellSubstrate + && bNoImplementationReviewDelegationWidening + == bComputedNoImplementationReviewDelegationWidening + && bNoPlanSynthesisWidening == bComputedNoPlanSynthesisWidening; +} + +bool FHyperTwistSkillImplementationDelegationSpec::IsStructurallyValid() const +{ + if (SpecId.IsEmpty() + || SkillId.IsEmpty() + || DisplayLabel.IsEmpty() + || CommandSurfaceId.IsEmpty() + || ServiceBindingId.IsEmpty() + || OwnerLaneId.IsEmpty() + || OwnerFeatureId.IsEmpty() + || InputArtifactKinds.Num() == 0 + || OutputArtifactKinds.Num() == 0 + || RequiredWorkflowReviewSkillIds.Num() == 0 + || RequiredWorkflowReviewSkillCount != RequiredWorkflowReviewSkillIds.Num() + || RequiredDesignShellSkillIds.Num() == 0 + || RequiredDesignShellSkillCount != RequiredDesignShellSkillIds.Num() + || SpecStepIds.Num() == 0 + || SafetyRuleIds.Num() == 0 + || !bUsesFirstPartyTermsOnly + || !bPreservesOptionalAssistiveOffState + || !bDerivedAssistiveOnly + || !bRequiresProvenanceLedger + || !bBoundedToImplementationReviewAndDelegationOnly + || !bAvoidsPlanSynthesisWidening + || !bAvoidsAutonomousExecutionClaims + || !bReadyForFutureWrapperBinding) + { + return false; + } + + if (!HyperTwistSkillTypesInternal::AreAllStringsPopulated(InputArtifactKinds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(OutputArtifactKinds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(RequiredWorkflowReviewSkillIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(RequiredDesignShellSkillIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(SpecStepIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(SafetyRuleIds)) + { + return false; + } + + const int32 SpecModeCount = + (bCoversImplementationReview ? 1 : 0) + (bDefinesBoundedDelegationSpec ? 1 : 0); + return SpecModeCount == 1; +} + +bool FHyperTwistSkillImplementationDelegationState::IsStructurallyValid() const +{ + if (RegistryId.IsEmpty() + || ManifestVersion.IsEmpty() + || ReferenceUtc.IsEmpty() + || CommandSurfaceRootId.IsEmpty() + || TemplateVersion.IsEmpty() + || Specs.Num() == 0 + || SkillCount <= 0 + || SpecCount != Specs.Num() + || StepCount <= 0 + || SafetyRuleCount <= 0 + || !bEverySpecUsesFirstPartyTerms + || !bEverySpecPreservesOptionalAssistiveOffState + || !bEverySpecRequiresProvenanceLedger + || !bEverySpecRemainsBounded + || !bEverySpecRequiresWorkflowReviewSubstrate + || !bEverySpecRequiresDesignShellSubstrate + || !bNoPlanSynthesisWidening + || !bNoAutonomousExecutionClaims + || !bEverySpecReadyForFutureWrapperBinding) + { + return false; + } + + TArray SeenSpecIds; + TArray SeenSkillIds; + TArray SeenStepIds; + TArray SeenSafetyRuleIds; + int32 ComputedImplementationReviewSpecCount = 0; + int32 ComputedDelegationSpecCount = 0; + bool bComputedFirstPartyTerms = true; + bool bComputedPreservesOffState = true; + bool bComputedRequiresProvenanceLedger = true; + bool bComputedRemainsBounded = true; + bool bComputedRequiresWorkflowReview = true; + bool bComputedRequiresDesignShell = true; + bool bComputedNoPlanSynthesisWidening = true; + bool bComputedNoAutonomousExecutionClaims = true; + bool bComputedReadyForFutureWrapperBinding = true; + + for (const FHyperTwistSkillImplementationDelegationSpec& Spec : Specs) + { + if (!Spec.IsStructurallyValid() || SeenSpecIds.Contains(Spec.SpecId)) + { + return false; + } + + SeenSpecIds.Add(Spec.SpecId); + SeenSkillIds.AddUnique(Spec.SkillId); + ComputedImplementationReviewSpecCount += Spec.bCoversImplementationReview ? 1 : 0; + ComputedDelegationSpecCount += Spec.bDefinesBoundedDelegationSpec ? 1 : 0; + bComputedFirstPartyTerms &= Spec.bUsesFirstPartyTermsOnly; + bComputedPreservesOffState &= Spec.bPreservesOptionalAssistiveOffState; + bComputedRequiresProvenanceLedger &= Spec.bRequiresProvenanceLedger; + bComputedRemainsBounded &= Spec.bBoundedToImplementationReviewAndDelegationOnly; + bComputedRequiresWorkflowReview &= Spec.RequiredWorkflowReviewSkillIds.Num() > 0; + bComputedRequiresDesignShell &= Spec.RequiredDesignShellSkillIds.Num() > 0; + bComputedNoPlanSynthesisWidening &= Spec.bAvoidsPlanSynthesisWidening; + bComputedNoAutonomousExecutionClaims &= Spec.bAvoidsAutonomousExecutionClaims; + bComputedReadyForFutureWrapperBinding &= Spec.bReadyForFutureWrapperBinding; + + for (const FString& StepId : Spec.SpecStepIds) + { + SeenStepIds.AddUnique(StepId); + } + + for (const FString& SafetyRuleId : Spec.SafetyRuleIds) + { + SeenSafetyRuleIds.AddUnique(SafetyRuleId); + } + } + + return SkillCount == SeenSkillIds.Num() + && StepCount == SeenStepIds.Num() + && SafetyRuleCount == SeenSafetyRuleIds.Num() + && ImplementationReviewSpecCount == ComputedImplementationReviewSpecCount + && DelegationSpecCount == ComputedDelegationSpecCount + && bEverySpecUsesFirstPartyTerms == bComputedFirstPartyTerms + && bEverySpecPreservesOptionalAssistiveOffState == bComputedPreservesOffState + && bEverySpecRequiresProvenanceLedger == bComputedRequiresProvenanceLedger + && bEverySpecRemainsBounded == bComputedRemainsBounded + && bEverySpecRequiresWorkflowReviewSubstrate == bComputedRequiresWorkflowReview + && bEverySpecRequiresDesignShellSubstrate == bComputedRequiresDesignShell + && bNoPlanSynthesisWidening == bComputedNoPlanSynthesisWidening + && bNoAutonomousExecutionClaims == bComputedNoAutonomousExecutionClaims + && bEverySpecReadyForFutureWrapperBinding == bComputedReadyForFutureWrapperBinding; +} + +bool FHyperTwistSkillPlanOrchestrationSkill::IsStructurallyValid() const +{ + if (SkillId.IsEmpty() + || DisplayLabel.IsEmpty() + || CommandSurfaceId.IsEmpty() + || ServiceBindingId.IsEmpty() + || OwnerLaneId.IsEmpty() + || OwnerFeatureId.IsEmpty() + || Status == EHyperTwistSkillStatus::None + || PermissionScopeIds.Num() == 0 + || SourceSurfaceIds.Num() == 0 + || RequiredImplementationDelegationSkillIds.Num() == 0 + || RequiredWorkflowMemorySkillIds.Num() == 0 + || RequiredWorkflowReviewSkillIds.Num() == 0 + || OutputArtifactKinds.Num() == 0 + || PreviewHeadlines.Num() == 0 + || SourceSurfaceCount != SourceSurfaceIds.Num() + || RequiredImplementationDelegationSkillCount + != RequiredImplementationDelegationSkillIds.Num() + || RequiredWorkflowMemorySkillCount != RequiredWorkflowMemorySkillIds.Num() + || RequiredWorkflowReviewSkillCount != RequiredWorkflowReviewSkillIds.Num() + || !bReadsAuthoritativeWorkflowImplementationAndMemorySurfaces + || !bPreservesOptionalAssistiveOffState + || !bDerivedAssistiveOnly + || !bHasValidationHarnessCoverage + || !bBoundedToPlanOrchestrationOnly + || !bRequiresImplementationDelegationSubstrate + || !bRequiresWorkflowMemorySubstrate + || !bRequiresWorkflowReviewSubstrate + || !bAvoidsProviderWidening + || !bAvoidsDomainSkillPackWidening + || !bAvoidsAutonomousExecutionClaims) + { + return false; + } + + if (!HyperTwistSkillTypesInternal::AreAllStringsPopulated(PermissionScopeIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(SourceSurfaceIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(RequiredImplementationDelegationSkillIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(RequiredWorkflowMemorySkillIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(RequiredWorkflowReviewSkillIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(OutputArtifactKinds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(PreviewHeadlines)) + { + return false; + } + + const int32 OrchestrationModeCount = + (bSynthesizesBoundedPlan ? 1 : 0) + (bChainsBoundedWorkflow ? 1 : 0); + return OrchestrationModeCount == 1 + && Status == EHyperTwistSkillStatus::ImplementedNow + && bLiveSkill + && bAvailableNow + && !bRequiresOwnerActivation; +} + +bool FHyperTwistSkillPlanOrchestrationState::IsStructurallyValid() const +{ + if (RegistryId.IsEmpty() + || ManifestVersion.IsEmpty() + || ReferenceUtc.IsEmpty() + || CommandSurfaceRootId.IsEmpty() + || TemplateVersion.IsEmpty() + || Skills.Num() == 0 + || SkillCount != Skills.Num() + || !bEveryLiveSkillReadsAuthoritativeWorkflowImplementationAndMemorySurfaces + || !bEverySkillPreservesOptionalAssistiveOffState + || !bEveryLiveSkillHasValidationHarnessCoverage + || !bPlanOrchestrationRemainsBounded + || !bEverySkillRequiresImplementationDelegationSubstrate + || !bEverySkillRequiresWorkflowMemorySubstrate + || !bEverySkillRequiresWorkflowReviewSubstrate + || !bNoProviderWidening + || !bNoDomainSkillPackWidening + || !bNoAutonomousExecutionClaims) + { + return false; + } + + TArray SeenSkillIds; + int32 ComputedLiveSkillCount = 0; + int32 ComputedAvailableNowCount = 0; + int32 ComputedPlanSynthesisSkillCount = 0; + int32 ComputedWorkflowChainingSkillCount = 0; + bool bComputedEveryLiveSkillReadsAuthoritativeWorkflowImplementationAndMemorySurfaces = + true; + bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; + bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; + bool bComputedPlanOrchestrationRemainsBounded = true; + bool bComputedEverySkillRequiresImplementationDelegationSubstrate = true; + bool bComputedEverySkillRequiresWorkflowMemorySubstrate = true; + bool bComputedEverySkillRequiresWorkflowReviewSubstrate = true; + bool bComputedNoProviderWidening = true; + bool bComputedNoDomainSkillPackWidening = true; + bool bComputedNoAutonomousExecutionClaims = true; + + for (const FHyperTwistSkillPlanOrchestrationSkill& Skill : Skills) + { + if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) + { + return false; + } + + SeenSkillIds.Add(Skill.SkillId); + ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; + ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; + ComputedPlanSynthesisSkillCount += Skill.bSynthesizesBoundedPlan ? 1 : 0; + ComputedWorkflowChainingSkillCount += Skill.bChainsBoundedWorkflow ? 1 : 0; + bComputedEverySkillPreservesOptionalAssistiveOffState &= + Skill.bPreservesOptionalAssistiveOffState; + bComputedPlanOrchestrationRemainsBounded &= Skill.bBoundedToPlanOrchestrationOnly; + bComputedEverySkillRequiresImplementationDelegationSubstrate &= + Skill.bRequiresImplementationDelegationSubstrate; + bComputedEverySkillRequiresWorkflowMemorySubstrate &= + Skill.bRequiresWorkflowMemorySubstrate; + bComputedEverySkillRequiresWorkflowReviewSubstrate &= + Skill.bRequiresWorkflowReviewSubstrate; + bComputedNoProviderWidening &= Skill.bAvoidsProviderWidening; + bComputedNoDomainSkillPackWidening &= Skill.bAvoidsDomainSkillPackWidening; + bComputedNoAutonomousExecutionClaims &= Skill.bAvoidsAutonomousExecutionClaims; + + if (Skill.bLiveSkill) + { + bComputedEveryLiveSkillReadsAuthoritativeWorkflowImplementationAndMemorySurfaces &= + Skill.bReadsAuthoritativeWorkflowImplementationAndMemorySurfaces; + bComputedEveryLiveSkillHasValidationHarnessCoverage &= + Skill.bHasValidationHarnessCoverage; + } + } + + return LiveSkillCount == ComputedLiveSkillCount + && AvailableNowCount == ComputedAvailableNowCount + && PlanSynthesisSkillCount == ComputedPlanSynthesisSkillCount + && WorkflowChainingSkillCount == ComputedWorkflowChainingSkillCount + && bEveryLiveSkillReadsAuthoritativeWorkflowImplementationAndMemorySurfaces + == bComputedEveryLiveSkillReadsAuthoritativeWorkflowImplementationAndMemorySurfaces + && bEverySkillPreservesOptionalAssistiveOffState + == bComputedEverySkillPreservesOptionalAssistiveOffState + && bEveryLiveSkillHasValidationHarnessCoverage + == bComputedEveryLiveSkillHasValidationHarnessCoverage + && bPlanOrchestrationRemainsBounded == bComputedPlanOrchestrationRemainsBounded + && bEverySkillRequiresImplementationDelegationSubstrate + == bComputedEverySkillRequiresImplementationDelegationSubstrate + && bEverySkillRequiresWorkflowMemorySubstrate + == bComputedEverySkillRequiresWorkflowMemorySubstrate + && bEverySkillRequiresWorkflowReviewSubstrate + == bComputedEverySkillRequiresWorkflowReviewSubstrate + && bNoProviderWidening == bComputedNoProviderWidening + && bNoDomainSkillPackWidening == bComputedNoDomainSkillPackWidening + && bNoAutonomousExecutionClaims == bComputedNoAutonomousExecutionClaims; +} + +bool FHyperTwistSkillProviderProfileRoutingSkill::IsStructurallyValid() const +{ + if (SkillId.IsEmpty() + || DisplayLabel.IsEmpty() + || CommandSurfaceId.IsEmpty() + || ServiceBindingId.IsEmpty() + || OwnerLaneId.IsEmpty() + || OwnerFeatureId.IsEmpty() + || Status == EHyperTwistSkillStatus::None + || PermissionScopeIds.Num() == 0 + || SourceSurfaceIds.Num() == 0 + || RequiredAnalyzerWrapperSkillIds.Num() == 0 + || OutputArtifactKinds.Num() == 0 + || PreviewHeadlines.Num() == 0 + || SourceSurfaceCount != SourceSurfaceIds.Num() + || RequiredAnalyzerWrapperSkillCount != RequiredAnalyzerWrapperSkillIds.Num() + || !bReadsAuthoritativeProviderNeutralState + || !bPreservesOptionalAssistiveOffState + || !bDerivedAssistiveOnly + || !bHasValidationHarnessCoverage + || !bBoundedToProviderProfileRoutingOnly + || !bRequiresAnalyzerWrapperSubstrate + || !bRequiresProviderSessionConfigState + || !bRequiresProviderServiceHealthState + || !bPreservesOpenAiCompatibleCustomEndpointFirstClass + || !bPreservesUserLabeledByokProfiles + || !bPreservesProviderNeutrality + || !bAvoidsProviderSpecificOverlayWidening) + { + return false; + } + + if (!HyperTwistSkillTypesInternal::AreAllStringsPopulated(PermissionScopeIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(SourceSurfaceIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(RequiredAnalyzerWrapperSkillIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(OutputArtifactKinds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(PreviewHeadlines)) + { + return false; + } + + const int32 ProviderModeCount = + (bInspectsProviderProfile ? 1 : 0) + + (bSetsUpByokProfile ? 1 : 0) + + (bDiagnosesRouting ? 1 : 0); + return ProviderModeCount == 1 + && Status == EHyperTwistSkillStatus::ImplementedNow + && bLiveSkill + && bAvailableNow + && !bRequiresOwnerActivation; +} + +bool FHyperTwistSkillProviderProfileRoutingState::IsStructurallyValid() const +{ + if (RegistryId.IsEmpty() + || ManifestVersion.IsEmpty() + || ReferenceUtc.IsEmpty() + || CommandSurfaceRootId.IsEmpty() + || TemplateVersion.IsEmpty() + || Skills.Num() == 0 + || SkillCount != Skills.Num() + || !bEveryLiveSkillReadsAuthoritativeProviderNeutralState + || !bEverySkillPreservesOptionalAssistiveOffState + || !bEveryLiveSkillHasValidationHarnessCoverage + || !bProviderProfileRoutingRemainsBounded + || !bEverySkillRequiresAnalyzerWrapperSubstrate + || !bEverySkillRequiresProviderSessionConfigState + || !bEverySkillRequiresProviderServiceHealthState + || !bOpenAiCompatibleCustomEndpointsRemainFirstClass + || !bUserLabeledByokProfilesRemainSupported + || !bProviderNeutralityRemainsPreserved + || !bNoProviderSpecificOverlayWidening) + { + return false; + } + + TArray SeenSkillIds; + int32 ComputedLiveSkillCount = 0; + int32 ComputedAvailableNowCount = 0; + int32 ComputedProviderProfileInspectionSkillCount = 0; + int32 ComputedByokProfileSetupSkillCount = 0; + int32 ComputedRoutingDiagnosticSkillCount = 0; + bool bComputedEveryLiveSkillReadsAuthoritativeProviderNeutralState = true; + bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; + bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; + bool bComputedProviderProfileRoutingRemainsBounded = true; + bool bComputedEverySkillRequiresAnalyzerWrapperSubstrate = true; + bool bComputedEverySkillRequiresProviderSessionConfigState = true; + bool bComputedEverySkillRequiresProviderServiceHealthState = true; + bool bComputedOpenAiCompatibleCustomEndpointsRemainFirstClass = true; + bool bComputedUserLabeledByokProfilesRemainSupported = true; + bool bComputedProviderNeutralityRemainsPreserved = true; + bool bComputedNoProviderSpecificOverlayWidening = true; + + for (const FHyperTwistSkillProviderProfileRoutingSkill& Skill : Skills) + { + if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) + { + return false; + } + + SeenSkillIds.Add(Skill.SkillId); + ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; + ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; + ComputedProviderProfileInspectionSkillCount += Skill.bInspectsProviderProfile ? 1 : 0; + ComputedByokProfileSetupSkillCount += Skill.bSetsUpByokProfile ? 1 : 0; + ComputedRoutingDiagnosticSkillCount += Skill.bDiagnosesRouting ? 1 : 0; + bComputedEverySkillPreservesOptionalAssistiveOffState &= + Skill.bPreservesOptionalAssistiveOffState; + bComputedProviderProfileRoutingRemainsBounded &= + Skill.bBoundedToProviderProfileRoutingOnly; + bComputedEverySkillRequiresAnalyzerWrapperSubstrate &= + Skill.bRequiresAnalyzerWrapperSubstrate; + bComputedEverySkillRequiresProviderSessionConfigState &= + Skill.bRequiresProviderSessionConfigState; + bComputedEverySkillRequiresProviderServiceHealthState &= + Skill.bRequiresProviderServiceHealthState; + bComputedOpenAiCompatibleCustomEndpointsRemainFirstClass &= + Skill.bPreservesOpenAiCompatibleCustomEndpointFirstClass; + bComputedUserLabeledByokProfilesRemainSupported &= + Skill.bPreservesUserLabeledByokProfiles; + bComputedProviderNeutralityRemainsPreserved &= + Skill.bPreservesProviderNeutrality; + bComputedNoProviderSpecificOverlayWidening &= + Skill.bAvoidsProviderSpecificOverlayWidening; + + if (Skill.bLiveSkill) + { + bComputedEveryLiveSkillReadsAuthoritativeProviderNeutralState &= + Skill.bReadsAuthoritativeProviderNeutralState; + bComputedEveryLiveSkillHasValidationHarnessCoverage &= + Skill.bHasValidationHarnessCoverage; + } + } + + return LiveSkillCount == ComputedLiveSkillCount + && AvailableNowCount == ComputedAvailableNowCount + && ProviderProfileInspectionSkillCount == ComputedProviderProfileInspectionSkillCount + && ByokProfileSetupSkillCount == ComputedByokProfileSetupSkillCount + && RoutingDiagnosticSkillCount == ComputedRoutingDiagnosticSkillCount + && bEveryLiveSkillReadsAuthoritativeProviderNeutralState + == bComputedEveryLiveSkillReadsAuthoritativeProviderNeutralState + && bEverySkillPreservesOptionalAssistiveOffState + == bComputedEverySkillPreservesOptionalAssistiveOffState + && bEveryLiveSkillHasValidationHarnessCoverage + == bComputedEveryLiveSkillHasValidationHarnessCoverage + && bProviderProfileRoutingRemainsBounded + == bComputedProviderProfileRoutingRemainsBounded + && bEverySkillRequiresAnalyzerWrapperSubstrate + == bComputedEverySkillRequiresAnalyzerWrapperSubstrate + && bEverySkillRequiresProviderSessionConfigState + == bComputedEverySkillRequiresProviderSessionConfigState + && bEverySkillRequiresProviderServiceHealthState + == bComputedEverySkillRequiresProviderServiceHealthState + && bOpenAiCompatibleCustomEndpointsRemainFirstClass + == bComputedOpenAiCompatibleCustomEndpointsRemainFirstClass + && bUserLabeledByokProfilesRemainSupported + == bComputedUserLabeledByokProfilesRemainSupported + && bProviderNeutralityRemainsPreserved + == bComputedProviderNeutralityRemainsPreserved + && bNoProviderSpecificOverlayWidening == bComputedNoProviderSpecificOverlayWidening; +} + +bool FHyperTwistSkillProviderUsageOperationsAuditSkill::IsStructurallyValid() const +{ + if (SkillId.IsEmpty() + || DisplayLabel.IsEmpty() + || CommandSurfaceId.IsEmpty() + || ServiceBindingId.IsEmpty() + || OwnerLaneId.IsEmpty() + || OwnerFeatureId.IsEmpty() + || Status == EHyperTwistSkillStatus::None + || PermissionScopeIds.Num() == 0 + || SourceSurfaceIds.Num() == 0 + || RequiredProviderProfileRoutingSkillIds.Num() == 0 + || OutputArtifactKinds.Num() == 0 + || PreviewHeadlines.Num() == 0 + || SourceSurfaceCount != SourceSurfaceIds.Num() + || RequiredProviderProfileRoutingSkillCount + != RequiredProviderProfileRoutingSkillIds.Num() + || !bReadsNormalizedFirstPartyState + || !bPreservesOptionalAssistiveOffState + || !bDerivedAssistiveOnly + || !bHasValidationHarnessCoverage + || !bBoundedToUsageOperationsAuditOnly + || !bRequiresProviderProfileRoutingSubstrate + || !bRequiresUsageCostAccountingState + || !bRequiresRouteAndServiceHealthState + || !bPreservesNormalizedFirstPartyAccountingOwnership + || !bAvoidsSettlementExecutionWidening + || !bAvoidsProviderPortalWidening) + { + return false; + } + + if (!HyperTwistSkillTypesInternal::AreAllStringsPopulated(PermissionScopeIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(SourceSurfaceIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(RequiredProviderProfileRoutingSkillIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(OutputArtifactKinds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(PreviewHeadlines)) + { + return false; + } + + const int32 AuditModeCount = + (bAuditsUsage ? 1 : 0) + + (bInspectsTopology ? 1 : 0) + + (bDiagnosesRouteService ? 1 : 0); + return AuditModeCount == 1 + && Status == EHyperTwistSkillStatus::ImplementedNow + && bLiveSkill + && bAvailableNow + && !bRequiresOwnerActivation; +} + +bool FHyperTwistSkillProviderUsageOperationsAuditState::IsStructurallyValid() const +{ + if (RegistryId.IsEmpty() + || ManifestVersion.IsEmpty() + || ReferenceUtc.IsEmpty() + || CommandSurfaceRootId.IsEmpty() + || TemplateVersion.IsEmpty() + || Skills.Num() == 0 + || SkillCount != Skills.Num() + || !bEveryLiveSkillReadsNormalizedFirstPartyState + || !bEverySkillPreservesOptionalAssistiveOffState + || !bEveryLiveSkillHasValidationHarnessCoverage + || !bUsageOperationsAuditRemainsBounded + || !bEverySkillRequiresProviderProfileRoutingSubstrate + || !bEverySkillRequiresUsageCostAccountingState + || !bEverySkillRequiresRouteAndServiceHealthState + || !bNormalizedFirstPartyAccountingOwnershipPreserved + || !bNoSettlementExecutionWidening + || !bNoProviderPortalWidening) + { + return false; + } + + TArray SeenSkillIds; + int32 ComputedLiveSkillCount = 0; + int32 ComputedAvailableNowCount = 0; + int32 ComputedUsageAuditSkillCount = 0; + int32 ComputedTopologyInspectionSkillCount = 0; + int32 ComputedRouteServiceDiagnosticSkillCount = 0; + bool bComputedEveryLiveSkillReadsNormalizedFirstPartyState = true; + bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; + bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; + bool bComputedUsageOperationsAuditRemainsBounded = true; + bool bComputedEverySkillRequiresProviderProfileRoutingSubstrate = true; + bool bComputedEverySkillRequiresUsageCostAccountingState = true; + bool bComputedEverySkillRequiresRouteAndServiceHealthState = true; + bool bComputedNormalizedFirstPartyAccountingOwnershipPreserved = true; + bool bComputedNoSettlementExecutionWidening = true; + bool bComputedNoProviderPortalWidening = true; + + for (const FHyperTwistSkillProviderUsageOperationsAuditSkill& Skill : Skills) + { + if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) + { + return false; + } + + SeenSkillIds.Add(Skill.SkillId); + ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; + ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; + ComputedUsageAuditSkillCount += Skill.bAuditsUsage ? 1 : 0; + ComputedTopologyInspectionSkillCount += Skill.bInspectsTopology ? 1 : 0; + ComputedRouteServiceDiagnosticSkillCount += Skill.bDiagnosesRouteService ? 1 : 0; + bComputedEverySkillPreservesOptionalAssistiveOffState &= + Skill.bPreservesOptionalAssistiveOffState; + bComputedUsageOperationsAuditRemainsBounded &= + Skill.bBoundedToUsageOperationsAuditOnly; + bComputedEverySkillRequiresProviderProfileRoutingSubstrate &= + Skill.bRequiresProviderProfileRoutingSubstrate; + bComputedEverySkillRequiresUsageCostAccountingState &= + Skill.bRequiresUsageCostAccountingState; + bComputedEverySkillRequiresRouteAndServiceHealthState &= + Skill.bRequiresRouteAndServiceHealthState; + bComputedNormalizedFirstPartyAccountingOwnershipPreserved &= + Skill.bPreservesNormalizedFirstPartyAccountingOwnership; + bComputedNoSettlementExecutionWidening &= Skill.bAvoidsSettlementExecutionWidening; + bComputedNoProviderPortalWidening &= Skill.bAvoidsProviderPortalWidening; + + if (Skill.bLiveSkill) + { + bComputedEveryLiveSkillReadsNormalizedFirstPartyState &= + Skill.bReadsNormalizedFirstPartyState; + bComputedEveryLiveSkillHasValidationHarnessCoverage &= + Skill.bHasValidationHarnessCoverage; + } + } + + return LiveSkillCount == ComputedLiveSkillCount + && AvailableNowCount == ComputedAvailableNowCount + && UsageAuditSkillCount == ComputedUsageAuditSkillCount + && TopologyInspectionSkillCount == ComputedTopologyInspectionSkillCount + && RouteServiceDiagnosticSkillCount == ComputedRouteServiceDiagnosticSkillCount + && bEveryLiveSkillReadsNormalizedFirstPartyState + == bComputedEveryLiveSkillReadsNormalizedFirstPartyState + && bEverySkillPreservesOptionalAssistiveOffState + == bComputedEverySkillPreservesOptionalAssistiveOffState + && bEveryLiveSkillHasValidationHarnessCoverage + == bComputedEveryLiveSkillHasValidationHarnessCoverage + && bUsageOperationsAuditRemainsBounded + == bComputedUsageOperationsAuditRemainsBounded + && bEverySkillRequiresProviderProfileRoutingSubstrate + == bComputedEverySkillRequiresProviderProfileRoutingSubstrate + && bEverySkillRequiresUsageCostAccountingState + == bComputedEverySkillRequiresUsageCostAccountingState + && bEverySkillRequiresRouteAndServiceHealthState + == bComputedEverySkillRequiresRouteAndServiceHealthState + && bNormalizedFirstPartyAccountingOwnershipPreserved + == bComputedNormalizedFirstPartyAccountingOwnershipPreserved + && bNoSettlementExecutionWidening == bComputedNoSettlementExecutionWidening + && bNoProviderPortalWidening == bComputedNoProviderPortalWidening; +} + +bool FHyperTwistSkillDomainPackFrameworkSkill::IsStructurallyValid() const +{ + if (SkillId.IsEmpty() + || DisplayLabel.IsEmpty() + || CommandSurfaceId.IsEmpty() + || ServiceBindingId.IsEmpty() + || OwnerLaneId.IsEmpty() + || OwnerFeatureId.IsEmpty() + || Status == EHyperTwistSkillStatus::None + || PermissionScopeIds.Num() == 0 + || SourceSurfaceIds.Num() == 0 + || RequiredPlanOrchestrationSkillIds.Num() == 0 + || RequiredProviderUsageAuditSkillIds.Num() == 0 + || OutputArtifactKinds.Num() == 0 + || PreviewHeadlines.Num() == 0 + || SourceSurfaceCount != SourceSurfaceIds.Num() + || RequiredPlanOrchestrationSkillCount + != RequiredPlanOrchestrationSkillIds.Num() + || RequiredProviderUsageAuditSkillCount + != RequiredProviderUsageAuditSkillIds.Num() + || !bReadsAuthoritativeSkillAndFrameworkState + || !bPreservesOptionalAssistiveOffState + || !bDerivedAssistiveOnly + || !bHasValidationHarnessCoverage + || !bBoundedToDomainPackFrameworkOnly + || !bRequiresPlanOrchestrationSubstrate + || !bRequiresProviderUsageOperationsAuditSubstrate + || !bPreservesPlaceholderDomainPackDeferral + || !bAvoidsRetainedDomainPackClaims + || !bAvoidsCreativeMediaWidening) + { + return false; + } + + if (!HyperTwistSkillTypesInternal::AreAllStringsPopulated(PermissionScopeIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(SourceSurfaceIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(RequiredPlanOrchestrationSkillIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(RequiredProviderUsageAuditSkillIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(OutputArtifactKinds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(PreviewHeadlines)) + { + return false; + } + + const int32 FrameworkModeCount = + (bSpecifiesPackagingRules ? 1 : 0) + + (bSpecifiesEnableDisableGrouping ? 1 : 0); + return FrameworkModeCount == 1 + && Status == EHyperTwistSkillStatus::ImplementedNow + && bLiveSkill + && bAvailableNow + && !bRequiresOwnerActivation; +} + +bool FHyperTwistSkillDomainPackFrameworkState::IsStructurallyValid() const +{ + if (RegistryId.IsEmpty() + || ManifestVersion.IsEmpty() + || ReferenceUtc.IsEmpty() + || CommandSurfaceRootId.IsEmpty() + || TemplateVersion.IsEmpty() + || Skills.Num() == 0 + || SkillCount != Skills.Num() + || !bEveryLiveSkillReadsAuthoritativeSkillAndFrameworkState + || !bEverySkillPreservesOptionalAssistiveOffState + || !bEveryLiveSkillHasValidationHarnessCoverage + || !bDomainPackFrameworkRemainsBounded + || !bEverySkillRequiresPlanOrchestrationSubstrate + || !bEverySkillRequiresProviderUsageOperationsAuditSubstrate + || !bPlaceholderDomainPackDeferralRemainsPreserved + || !bNoRetainedDomainPackClaims + || !bNoCreativeMediaWidening) + { + return false; + } + + TArray SeenSkillIds; + int32 ComputedLiveSkillCount = 0; + int32 ComputedAvailableNowCount = 0; + int32 ComputedPackagingRuleSkillCount = 0; + int32 ComputedEnableDisableGroupingSkillCount = 0; + bool bComputedEveryLiveSkillReadsAuthoritativeSkillAndFrameworkState = true; + bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; + bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; + bool bComputedDomainPackFrameworkRemainsBounded = true; + bool bComputedEverySkillRequiresPlanOrchestrationSubstrate = true; + bool bComputedEverySkillRequiresProviderUsageOperationsAuditSubstrate = true; + bool bComputedPlaceholderDomainPackDeferralRemainsPreserved = true; + bool bComputedNoRetainedDomainPackClaims = true; + bool bComputedNoCreativeMediaWidening = true; + + for (const FHyperTwistSkillDomainPackFrameworkSkill& Skill : Skills) + { + if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) + { + return false; + } + + SeenSkillIds.Add(Skill.SkillId); + ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; + ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; + ComputedPackagingRuleSkillCount += Skill.bSpecifiesPackagingRules ? 1 : 0; + ComputedEnableDisableGroupingSkillCount += + Skill.bSpecifiesEnableDisableGrouping ? 1 : 0; + bComputedEverySkillPreservesOptionalAssistiveOffState &= + Skill.bPreservesOptionalAssistiveOffState; + bComputedDomainPackFrameworkRemainsBounded &= + Skill.bBoundedToDomainPackFrameworkOnly; + bComputedEverySkillRequiresPlanOrchestrationSubstrate &= + Skill.bRequiresPlanOrchestrationSubstrate; + bComputedEverySkillRequiresProviderUsageOperationsAuditSubstrate &= + Skill.bRequiresProviderUsageOperationsAuditSubstrate; + bComputedPlaceholderDomainPackDeferralRemainsPreserved &= + Skill.bPreservesPlaceholderDomainPackDeferral; + bComputedNoRetainedDomainPackClaims &= + Skill.bAvoidsRetainedDomainPackClaims; + bComputedNoCreativeMediaWidening &= + Skill.bAvoidsCreativeMediaWidening; + + if (Skill.bLiveSkill) + { + bComputedEveryLiveSkillReadsAuthoritativeSkillAndFrameworkState &= + Skill.bReadsAuthoritativeSkillAndFrameworkState; + bComputedEveryLiveSkillHasValidationHarnessCoverage &= + Skill.bHasValidationHarnessCoverage; + } + } + + return LiveSkillCount == ComputedLiveSkillCount + && AvailableNowCount == ComputedAvailableNowCount + && PackagingRuleSkillCount == ComputedPackagingRuleSkillCount + && EnableDisableGroupingSkillCount + == ComputedEnableDisableGroupingSkillCount + && bEveryLiveSkillReadsAuthoritativeSkillAndFrameworkState + == bComputedEveryLiveSkillReadsAuthoritativeSkillAndFrameworkState + && bEverySkillPreservesOptionalAssistiveOffState + == bComputedEverySkillPreservesOptionalAssistiveOffState + && bEveryLiveSkillHasValidationHarnessCoverage + == bComputedEveryLiveSkillHasValidationHarnessCoverage + && bDomainPackFrameworkRemainsBounded + == bComputedDomainPackFrameworkRemainsBounded + && bEverySkillRequiresPlanOrchestrationSubstrate + == bComputedEverySkillRequiresPlanOrchestrationSubstrate + && bEverySkillRequiresProviderUsageOperationsAuditSubstrate + == bComputedEverySkillRequiresProviderUsageOperationsAuditSubstrate + && bPlaceholderDomainPackDeferralRemainsPreserved + == bComputedPlaceholderDomainPackDeferralRemainsPreserved + && bNoRetainedDomainPackClaims == bComputedNoRetainedDomainPackClaims + && bNoCreativeMediaWidening == bComputedNoCreativeMediaWidening; +} + +bool FHyperTwistSkillRetainedDomainPackSkill::IsStructurallyValid() const +{ + if (SkillId.IsEmpty() + || DisplayLabel.IsEmpty() + || CommandSurfaceId.IsEmpty() + || ServiceBindingId.IsEmpty() + || OwnerLaneId.IsEmpty() + || OwnerFeatureId.IsEmpty() + || Status == EHyperTwistSkillStatus::None + || PermissionScopeIds.Num() == 0 + || SourceSurfaceIds.Num() == 0 + || RequiredDomainPackFrameworkSkillIds.Num() == 0 + || OutputArtifactKinds.Num() == 0 + || PreviewHeadlines.Num() == 0 + || SourceSurfaceCount != SourceSurfaceIds.Num() + || RequiredDomainPackFrameworkSkillCount + != RequiredDomainPackFrameworkSkillIds.Num() + || !bReadsAuthoritativeFirstPartyDomainState + || !bPreservesOptionalAssistiveOffState + || !bDerivedAssistiveOnly + || !bHasValidationHarnessCoverage + || !bBoundedToRetainedDomainPackOnly + || !bRequiresDomainPackFrameworkSubstrate + || !bPreservesFirstPartyRetainedPackGrounding + || !bPreservesUnlandedPackDeferral + || !bAvoidsCreativeAdjunctWidening) + { + return false; + } + + if (!HyperTwistSkillTypesInternal::AreAllStringsPopulated(PermissionScopeIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(SourceSurfaceIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(RequiredDomainPackFrameworkSkillIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(OutputArtifactKinds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(PreviewHeadlines)) + { + return false; + } + + const int32 PackModeCount = + (bReadsTrainingReplayState ? 1 : 0) + + (bReadsCurriculumContentState ? 1 : 0) + + (bReadsMediaExportState ? 1 : 0); + return PackModeCount == 1 + && Status == EHyperTwistSkillStatus::ImplementedNow + && bLiveSkill + && bAvailableNow + && !bRequiresOwnerActivation; +} + +bool FHyperTwistSkillRetainedDomainPackState::IsStructurallyValid() const +{ + if (RegistryId.IsEmpty() + || ManifestVersion.IsEmpty() + || ReferenceUtc.IsEmpty() + || CommandSurfaceRootId.IsEmpty() + || TemplateVersion.IsEmpty() + || Skills.Num() == 0 + || SkillCount != Skills.Num() + || !bEveryLiveSkillReadsAuthoritativeFirstPartyDomainState + || !bEverySkillPreservesOptionalAssistiveOffState + || !bEveryLiveSkillHasValidationHarnessCoverage + || !bRetainedDomainPackLayerRemainsBounded + || !bEverySkillRequiresDomainPackFrameworkSubstrate + || !bRetainedPackClaimsRemainFirstPartyGrounded + || !bUnlandedPackDeferralRemainsPreserved + || !bNoCreativeAdjunctWidening) + { + return false; + } + + TArray SeenSkillIds; + int32 ComputedLiveSkillCount = 0; + int32 ComputedAvailableNowCount = 0; + int32 ComputedTrainingReplayPackSkillCount = 0; + int32 ComputedCurriculumContentPackSkillCount = 0; + int32 ComputedMediaExportPackSkillCount = 0; + bool bComputedEveryLiveSkillReadsAuthoritativeFirstPartyDomainState = true; + bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; + bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; + bool bComputedRetainedDomainPackLayerRemainsBounded = true; + bool bComputedEverySkillRequiresDomainPackFrameworkSubstrate = true; + bool bComputedRetainedPackClaimsRemainFirstPartyGrounded = true; + bool bComputedUnlandedPackDeferralRemainsPreserved = true; + bool bComputedNoCreativeAdjunctWidening = true; + + for (const FHyperTwistSkillRetainedDomainPackSkill& Skill : Skills) + { + if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) + { + return false; + } + + SeenSkillIds.Add(Skill.SkillId); + ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; + ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; + ComputedTrainingReplayPackSkillCount += + Skill.bReadsTrainingReplayState ? 1 : 0; + ComputedCurriculumContentPackSkillCount += + Skill.bReadsCurriculumContentState ? 1 : 0; + ComputedMediaExportPackSkillCount += + Skill.bReadsMediaExportState ? 1 : 0; + bComputedEverySkillPreservesOptionalAssistiveOffState &= + Skill.bPreservesOptionalAssistiveOffState; + bComputedRetainedDomainPackLayerRemainsBounded &= + Skill.bBoundedToRetainedDomainPackOnly; + bComputedEverySkillRequiresDomainPackFrameworkSubstrate &= + Skill.bRequiresDomainPackFrameworkSubstrate; + bComputedRetainedPackClaimsRemainFirstPartyGrounded &= + Skill.bPreservesFirstPartyRetainedPackGrounding; + bComputedUnlandedPackDeferralRemainsPreserved &= + Skill.bPreservesUnlandedPackDeferral; + bComputedNoCreativeAdjunctWidening &= + Skill.bAvoidsCreativeAdjunctWidening; + + if (Skill.bLiveSkill) + { + bComputedEveryLiveSkillReadsAuthoritativeFirstPartyDomainState &= + Skill.bReadsAuthoritativeFirstPartyDomainState; + bComputedEveryLiveSkillHasValidationHarnessCoverage &= + Skill.bHasValidationHarnessCoverage; + } + } + + return LiveSkillCount == ComputedLiveSkillCount + && AvailableNowCount == ComputedAvailableNowCount + && TrainingReplayPackSkillCount + == ComputedTrainingReplayPackSkillCount + && CurriculumContentPackSkillCount + == ComputedCurriculumContentPackSkillCount + && MediaExportPackSkillCount == ComputedMediaExportPackSkillCount + && bEveryLiveSkillReadsAuthoritativeFirstPartyDomainState + == bComputedEveryLiveSkillReadsAuthoritativeFirstPartyDomainState + && bEverySkillPreservesOptionalAssistiveOffState + == bComputedEverySkillPreservesOptionalAssistiveOffState + && bEveryLiveSkillHasValidationHarnessCoverage + == bComputedEveryLiveSkillHasValidationHarnessCoverage + && bRetainedDomainPackLayerRemainsBounded + == bComputedRetainedDomainPackLayerRemainsBounded + && bEverySkillRequiresDomainPackFrameworkSubstrate + == bComputedEverySkillRequiresDomainPackFrameworkSubstrate + && bRetainedPackClaimsRemainFirstPartyGrounded + == bComputedRetainedPackClaimsRemainFirstPartyGrounded + && bUnlandedPackDeferralRemainsPreserved + == bComputedUnlandedPackDeferralRemainsPreserved + && bNoCreativeAdjunctWidening + == bComputedNoCreativeAdjunctWidening; +} + +bool FHyperTwistSkillCreativeMediaPackSkill::IsStructurallyValid() const +{ + if (SkillId.IsEmpty() + || DisplayLabel.IsEmpty() + || CommandSurfaceId.IsEmpty() + || ServiceBindingId.IsEmpty() + || OwnerLaneId.IsEmpty() + || OwnerFeatureId.IsEmpty() + || Status == EHyperTwistSkillStatus::None + || PermissionScopeIds.Num() == 0 + || SourceSurfaceIds.Num() == 0 + || RequiredRetainedDomainPackSkillIds.Num() == 0 + || OutputArtifactKinds.Num() == 0 + || PreviewHeadlines.Num() == 0 + || SourceSurfaceCount != SourceSurfaceIds.Num() + || RequiredRetainedDomainPackSkillCount + != RequiredRetainedDomainPackSkillIds.Num() + || !bReadsAuthoritativeFirstPartyCreativeMediaState + || !bPreservesOptionalAssistiveOffState + || !bDerivedAssistiveOnly + || !bHasValidationHarnessCoverage + || !bBoundedToCreativeMediaPackOnly + || !bRequiresRetainedDomainPackSubstrate + || !bCreativeMediaAdjunctOnly + || !bAvoidsCoreRuntimePromotion + || !bBoundarySensitiveLicensingRemainsExplicit) + { + return false; + } + + if (!HyperTwistSkillTypesInternal::AreAllStringsPopulated(PermissionScopeIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(SourceSurfaceIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(RequiredRetainedDomainPackSkillIds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(OutputArtifactKinds) + || !HyperTwistSkillTypesInternal::AreAllStringsPopulated(PreviewHeadlines)) + { + return false; + } + + const int32 PackModeCount = + (bReadsReplayExplainerState ? 1 : 0) + + (bReadsMediaParserState ? 1 : 0) + + (bReadsSharedFixtureState ? 1 : 0); + return PackModeCount == 1 + && Status == EHyperTwistSkillStatus::ImplementedNow + && bLiveSkill + && bAvailableNow + && !bRequiresOwnerActivation; +} + +bool FHyperTwistSkillCreativeMediaPackState::IsStructurallyValid() const +{ + if (RegistryId.IsEmpty() + || ManifestVersion.IsEmpty() + || ReferenceUtc.IsEmpty() + || CommandSurfaceRootId.IsEmpty() + || TemplateVersion.IsEmpty() + || Skills.Num() == 0 + || SkillCount != Skills.Num() + || !bEveryLiveSkillReadsAuthoritativeFirstPartyCreativeMediaState + || !bEverySkillPreservesOptionalAssistiveOffState + || !bEveryLiveSkillHasValidationHarnessCoverage + || !bCreativeMediaPackLayerRemainsBounded + || !bEverySkillRequiresRetainedDomainPackSubstrate + || !bCreativeMediaAdjunctsRemainOptional + || !bNoCoreRuntimePromotion + || !bBoundarySensitiveLicensingRemainsExplicit) + { + return false; + } + + TArray SeenSkillIds; + int32 ComputedLiveSkillCount = 0; + int32 ComputedAvailableNowCount = 0; + int32 ComputedReplayExplainerPackSkillCount = 0; + int32 ComputedMediaParserPackSkillCount = 0; + int32 ComputedSharedFixturePackSkillCount = 0; + bool bComputedEveryLiveSkillReadsAuthoritativeFirstPartyCreativeMediaState = + true; + bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; + bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; + bool bComputedCreativeMediaPackLayerRemainsBounded = true; + bool bComputedEverySkillRequiresRetainedDomainPackSubstrate = true; + bool bComputedCreativeMediaAdjunctsRemainOptional = true; + bool bComputedNoCoreRuntimePromotion = true; + bool bComputedBoundarySensitiveLicensingRemainsExplicit = true; + + for (const FHyperTwistSkillCreativeMediaPackSkill& Skill : Skills) + { + if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) + { + return false; + } + + SeenSkillIds.Add(Skill.SkillId); + ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; + ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; + ComputedReplayExplainerPackSkillCount += + Skill.bReadsReplayExplainerState ? 1 : 0; + ComputedMediaParserPackSkillCount += + Skill.bReadsMediaParserState ? 1 : 0; + ComputedSharedFixturePackSkillCount += + Skill.bReadsSharedFixtureState ? 1 : 0; + bComputedEverySkillPreservesOptionalAssistiveOffState &= + Skill.bPreservesOptionalAssistiveOffState; + bComputedCreativeMediaPackLayerRemainsBounded &= + Skill.bBoundedToCreativeMediaPackOnly; + bComputedEverySkillRequiresRetainedDomainPackSubstrate &= + Skill.bRequiresRetainedDomainPackSubstrate; + bComputedCreativeMediaAdjunctsRemainOptional &= + Skill.bCreativeMediaAdjunctOnly; + bComputedNoCoreRuntimePromotion &= Skill.bAvoidsCoreRuntimePromotion; + bComputedBoundarySensitiveLicensingRemainsExplicit &= + Skill.bBoundarySensitiveLicensingRemainsExplicit; + + if (Skill.bLiveSkill) + { + bComputedEveryLiveSkillReadsAuthoritativeFirstPartyCreativeMediaState &= + Skill.bReadsAuthoritativeFirstPartyCreativeMediaState; + bComputedEveryLiveSkillHasValidationHarnessCoverage &= + Skill.bHasValidationHarnessCoverage; + } + } + + return LiveSkillCount == ComputedLiveSkillCount + && AvailableNowCount == ComputedAvailableNowCount + && ReplayExplainerPackSkillCount + == ComputedReplayExplainerPackSkillCount + && MediaParserPackSkillCount == ComputedMediaParserPackSkillCount + && SharedFixturePackSkillCount == ComputedSharedFixturePackSkillCount + && bEveryLiveSkillReadsAuthoritativeFirstPartyCreativeMediaState + == bComputedEveryLiveSkillReadsAuthoritativeFirstPartyCreativeMediaState + && bEverySkillPreservesOptionalAssistiveOffState + == bComputedEverySkillPreservesOptionalAssistiveOffState + && bEveryLiveSkillHasValidationHarnessCoverage + == bComputedEveryLiveSkillHasValidationHarnessCoverage + && bCreativeMediaPackLayerRemainsBounded + == bComputedCreativeMediaPackLayerRemainsBounded + && bEverySkillRequiresRetainedDomainPackSubstrate + == bComputedEverySkillRequiresRetainedDomainPackSubstrate + && bCreativeMediaAdjunctsRemainOptional + == bComputedCreativeMediaAdjunctsRemainOptional + && bNoCoreRuntimePromotion == bComputedNoCoreRuntimePromotion + && bBoundarySensitiveLicensingRemainsExplicit + == bComputedBoundarySensitiveLicensingRemainsExplicit; +} diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistRecognition/HyperTwistRecognitionTypes.h b/UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistRecognition/HyperTwistRecognitionTypes.h index c8063c4..ccc0253 100644 --- a/UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistRecognition/HyperTwistRecognitionTypes.h +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistRecognition/HyperTwistRecognitionTypes.h @@ -592,55 +592,7 @@ struct FHyperTwistVisionShellProfile UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") TArray ActionBindings; - bool IsStructurallyValid() const - { - if (ShellProfileId.IsEmpty() - || ShellKind.IsEmpty() - || DefaultLocaleCode.IsEmpty() - || FontReviewProfileId.IsEmpty() - || !FontReviewProfileDefinition.IsStructurallyValid() - || SupportedFontReviews.Num() <= 0 - || SupportedLocales.Num() <= 0 - || Panels.Num() <= 0 - || ActionBindings.Num() <= 0) - { - return false; - } - - for (const FHyperTwistVisionLocaleOption& LocaleOption : SupportedLocales) - { - if (!LocaleOption.IsStructurallyValid()) - { - return false; - } - } - - for (const FHyperTwistVisionFontReviewDescriptor& FontReview : SupportedFontReviews) - { - if (!FontReview.IsStructurallyValid()) - { - return false; - } - } - - for (const FHyperTwistVisionShellPanelLayout& Panel : Panels) - { - if (!Panel.IsStructurallyValid()) - { - return false; - } - } - - for (const FHyperTwistVisionShellActionBinding& ActionBinding : ActionBindings) - { - if (!ActionBinding.IsStructurallyValid()) - { - return false; - } - } - - return true; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -1076,58 +1028,7 @@ struct FHyperTwistVisionSolveExplanationProfile UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") TArray ActionBindings; - bool IsStructurallyValid() const - { - if (ExplanationProfileId.IsEmpty() - || PuzzleId.IsEmpty() - || RecommendationMode.IsEmpty() - || LocaleGuidanceMode.IsEmpty() - || DefaultLocaleCode.IsEmpty() - || StartingOrientationHint.IsEmpty() - || FontReviewProfileId.IsEmpty() - || !FontReviewProfileDefinition.IsStructurallyValid() - || SupportedFontReviews.Num() <= 0 - || SupportedLocales.Num() <= 0 - || Steps.Num() <= 0 - || ActionBindings.Num() <= 0) - { - return false; - } - - for (const FHyperTwistVisionLocaleOption& LocaleOption : SupportedLocales) - { - if (!LocaleOption.IsStructurallyValid()) - { - return false; - } - } - - for (const FHyperTwistVisionFontReviewDescriptor& FontReview : SupportedFontReviews) - { - if (!FontReview.IsStructurallyValid()) - { - return false; - } - } - - for (const FHyperTwistVisionSolveExplanationStep& Step : Steps) - { - if (!Step.IsStructurallyValid()) - { - return false; - } - } - - for (const FHyperTwistVisionShellActionBinding& ActionBinding : ActionBindings) - { - if (!ActionBinding.IsStructurallyValid()) - { - return false; - } - } - - return true; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -1470,59 +1371,7 @@ struct FHyperTwistVisionCorrectionState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") bool bCorrectionComplete = false; - bool IsStructurallyValid() const - { - if (CorrectionProfileId.IsEmpty() - || MissingFaceCount < 0 - || ContradictionCount < 0 - || ContradictionCount != Contradictions.Num() - || ResolvedCorrectionCount < 0 - || ResolvedCorrectionCount != ResolutionLedger.Num()) - { - return false; - } - - if (bCorrectionRequired) - { - if (ActiveTargetFaceId.IsEmpty() - || !ActiveTarget.IsStructurallyValid() - || ActiveTargetFaceId != ActiveTarget.FaceId) - { - return false; - } - } - - for (const FHyperTwistVisionCorrectionTarget& Target : PendingTargets) - { - if (!Target.IsStructurallyValid()) - { - return false; - } - } - - for (const FHyperTwistVisionCorrectionContradiction& Contradiction : Contradictions) - { - if (!Contradiction.IsStructurallyValid()) - { - return false; - } - } - - if (!LastResolution.ResolutionId.IsEmpty() && !LastResolution.IsStructurallyValid()) - { - return false; - } - - for (const FHyperTwistVisionCorrectionResolution& Resolution : ResolutionLedger) - { - if (!Resolution.IsStructurallyValid()) - { - return false; - } - } - - return true; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -2191,61 +2040,7 @@ struct FHyperTwistSpeechMicrophoneShellState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") TArray AvailableActionIds; - bool IsStructurallyValid() const - { - if (MicrophoneShellProfileId.IsEmpty() - || CaptureMode.IsEmpty() - || ListeningContractId.IsEmpty() - || InputRouteId.IsEmpty() - || PermissionStateId.IsEmpty() - || CaptureRouteStateId.IsEmpty() - || LastLanguageCode.IsEmpty() - || StatusLine.IsEmpty() - || DetailLine.IsEmpty() - || StepWindowMs <= 0 - || CaptureWindowMs < StepWindowMs - || KeepWindowMs < 0 - || KeepWindowMs > CaptureWindowMs - || SubmittedUtteranceCount < 0 - || FinalTranscriptCount < 0 - || DetectedSpeechStartMs < 0 - || DetectedSpeechEndMs < DetectedSpeechStartMs - || LastSilenceGapMs < 0 - || VadThreshold <= 0.0f - || ActiveIssueCount < 0 - || AvailableActionIds.Num() <= 0) - { - return false; - } - - if (ActiveIssueCount != Issues.Num()) - { - return false; - } - - if (ActiveIssueCount > 0 && !ActiveIssue.IsStructurallyValid()) - { - return false; - } - - for (const FHyperTwistSpeechMicrophoneShellIssue& Issue : Issues) - { - if (!Issue.IsStructurallyValid()) - { - return false; - } - } - - for (const FString& ActionId : AvailableActionIds) - { - if (ActionId.IsEmpty()) - { - return false; - } - } - - return true; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -2292,40 +2087,7 @@ struct FHyperTwistSpeechDevicePermissionWorkflowProfile UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") TArray ActionBindings; - bool IsStructurallyValid() const - { - if (DevicePermissionWorkflowProfileId.IsEmpty() - || WorkflowKind.IsEmpty() - || PermissionContractId.IsEmpty() - || SettingsHandoffContractId.IsEmpty() - || PermissionRecheckContractId.IsEmpty() - || PermissionRequestActionId.IsEmpty() - || OpenSettingsActionId.IsEmpty() - || PermissionRecheckActionId.IsEmpty() - || Panels.Num() <= 0 - || ActionBindings.Num() <= 0) - { - return false; - } - - for (const FHyperTwistSpeechShellPanelLayout& Panel : Panels) - { - if (!Panel.IsStructurallyValid()) - { - return false; - } - } - - for (const FHyperTwistSpeechShellActionBinding& ActionBinding : ActionBindings) - { - if (!ActionBinding.IsStructurallyValid()) - { - return false; - } - } - - return true; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -2360,15 +2122,7 @@ struct FHyperTwistSpeechDevicePermissionWorkflowEntry UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") bool bPermissionGranted = true; - bool IsStructurallyValid() const - { - return !EntryId.IsEmpty() - && !SourceKind.IsEmpty() - && !WorkflowStateId.IsEmpty() - && !StatusLine.IsEmpty() - && !DetailLine.IsEmpty() - && !RecommendedActionId.IsEmpty(); - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -2394,14 +2148,7 @@ struct FHyperTwistSpeechDevicePermissionWorkflowIssue UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") bool bBlocksCaptureStart = true; - bool IsStructurallyValid() const - { - return !IssueId.IsEmpty() - && !IssueKind.IsEmpty() - && !StatusLine.IsEmpty() - && !DetailLine.IsEmpty() - && !RecommendedActionId.IsEmpty(); - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -2479,64 +2226,7 @@ struct FHyperTwistSpeechDevicePermissionWorkflowState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") TArray AvailableActionIds; - bool IsStructurallyValid() const - { - if (DevicePermissionWorkflowProfileId.IsEmpty() - || WorkflowStateId.IsEmpty() - || PermissionStateId.IsEmpty() - || LatestSourceKind.IsEmpty() - || StatusLine.IsEmpty() - || DetailLine.IsEmpty() - || WorkflowEntryCount < 0 - || PermissionRequestEntryCount < 0 - || SettingsHandoffEntryCount < 0 - || PermissionRecheckEntryCount < 0 - || ActiveIssueCount < 0 - || AvailableActionIds.Num() <= 0) - { - return false; - } - - if (WorkflowEntryCount != Entries.Num() - || ActiveIssueCount != Issues.Num() - || PermissionRequestEntryCount > WorkflowEntryCount - || SettingsHandoffEntryCount > WorkflowEntryCount - || PermissionRecheckEntryCount > WorkflowEntryCount) - { - return false; - } - - if (ActiveIssueCount > 0 && !ActiveIssue.IsStructurallyValid()) - { - return false; - } - - for (const FHyperTwistSpeechDevicePermissionWorkflowEntry& Entry : Entries) - { - if (!Entry.IsStructurallyValid()) - { - return false; - } - } - - for (const FHyperTwistSpeechDevicePermissionWorkflowIssue& Issue : Issues) - { - if (!Issue.IsStructurallyValid()) - { - return false; - } - } - - for (const FString& ActionId : AvailableActionIds) - { - if (ActionId.IsEmpty()) - { - return false; - } - } - - return true; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -2586,41 +2276,7 @@ struct FHyperTwistSpeechNativeCaptureRouteWorkflowProfile UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") TArray ActionBindings; - bool IsStructurallyValid() const - { - if (NativeCaptureRouteWorkflowProfileId.IsEmpty() - || WorkflowKind.IsEmpty() - || OwnershipContractId.IsEmpty() - || PreparationContractId.IsEmpty() - || SessionReopenContractId.IsEmpty() - || RouteInspectActionId.IsEmpty() - || PreparationRetryActionId.IsEmpty() - || SessionReopenActionId.IsEmpty() - || PermissionDependencyActionId.IsEmpty() - || Panels.Num() <= 0 - || ActionBindings.Num() <= 0) - { - return false; - } - - for (const FHyperTwistSpeechShellPanelLayout& Panel : Panels) - { - if (!Panel.IsStructurallyValid()) - { - return false; - } - } - - for (const FHyperTwistSpeechShellActionBinding& ActionBinding : ActionBindings) - { - if (!ActionBinding.IsStructurallyValid()) - { - return false; - } - } - - return true; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -2664,16 +2320,7 @@ struct FHyperTwistSpeechNativeCaptureRouteWorkflowEntry UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") bool bOwnershipConfirmed = false; - bool IsStructurallyValid() const - { - return !EntryId.IsEmpty() - && !SourceKind.IsEmpty() - && !WorkflowStateId.IsEmpty() - && !CaptureRouteStateId.IsEmpty() - && !StatusLine.IsEmpty() - && !DetailLine.IsEmpty() - && !RecommendedActionId.IsEmpty(); - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -2699,14 +2346,7 @@ struct FHyperTwistSpeechNativeCaptureRouteWorkflowIssue UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") bool bBlocksCaptureStart = true; - bool IsStructurallyValid() const - { - return !IssueId.IsEmpty() - && !IssueKind.IsEmpty() - && !StatusLine.IsEmpty() - && !DetailLine.IsEmpty() - && !RecommendedActionId.IsEmpty(); - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -2799,69 +2439,7 @@ struct FHyperTwistSpeechNativeCaptureRouteWorkflowState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") TArray AvailableActionIds; - bool IsStructurallyValid() const - { - if (NativeCaptureRouteWorkflowProfileId.IsEmpty() - || WorkflowStateId.IsEmpty() - || CaptureRouteStateId.IsEmpty() - || PermissionStateId.IsEmpty() - || ActiveProviderProfileId.IsEmpty() - || ActiveServiceLaneId.IsEmpty() - || LatestSourceKind.IsEmpty() - || StatusLine.IsEmpty() - || DetailLine.IsEmpty() - || WorkflowEntryCount < 0 - || PreparationEntryCount < 0 - || RouteRetryEntryCount < 0 - || SessionReopenEntryCount < 0 - || PermissionDependencyEntryCount < 0 - || ActiveIssueCount < 0 - || AvailableActionIds.Num() <= 0) - { - return false; - } - - if (WorkflowEntryCount != Entries.Num() - || ActiveIssueCount != Issues.Num() - || PreparationEntryCount > WorkflowEntryCount - || RouteRetryEntryCount > WorkflowEntryCount - || SessionReopenEntryCount > WorkflowEntryCount - || PermissionDependencyEntryCount > WorkflowEntryCount) - { - return false; - } - - if (ActiveIssueCount > 0 && !ActiveIssue.IsStructurallyValid()) - { - return false; - } - - for (const FHyperTwistSpeechNativeCaptureRouteWorkflowEntry& Entry : Entries) - { - if (!Entry.IsStructurallyValid()) - { - return false; - } - } - - for (const FHyperTwistSpeechNativeCaptureRouteWorkflowIssue& Issue : Issues) - { - if (!Issue.IsStructurallyValid()) - { - return false; - } - } - - for (const FString& ActionId : AvailableActionIds) - { - if (ActionId.IsEmpty()) - { - return false; - } - } - - return true; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -3233,57 +2811,7 @@ struct FHyperTwistSpeechProviderRoutingPolicy UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") bool bAllowsDonorOwnedRoutingLanguage = false; - bool IsStructurallyValid() const - { - if (ProviderRoutingPolicyId.IsEmpty() - || PolicyKind.IsEmpty() - || RouteSelectionMode.IsEmpty() - || FallbackMode.IsEmpty() - || WorkflowPolicyState.IsEmpty() - || FailureEscalationMode.IsEmpty() - || UserOverridePosture.IsEmpty() - || EligibleProviderClasses.Num() <= 0 - || EligibleEndpointClasses.Num() <= 0 - || RequiredCapabilityFlags.Num() <= 0 - || SupportedTaskKinds.Num() <= 0) - { - return false; - } - - for (const FString& ProviderClassId : EligibleProviderClasses) - { - if (ProviderClassId.IsEmpty()) - { - return false; - } - } - - for (const FString& EndpointClassId : EligibleEndpointClasses) - { - if (EndpointClassId.IsEmpty()) - { - return false; - } - } - - for (const FString& CapabilityFlag : RequiredCapabilityFlags) - { - if (CapabilityFlag.IsEmpty()) - { - return false; - } - } - - for (const FString& TaskKindId : SupportedTaskKinds) - { - if (TaskKindId.IsEmpty()) - { - return false; - } - } - - return true; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -3683,41 +3211,7 @@ struct FHyperTwistSpeechNativeCaptureRouteShellProfile UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") TArray ActionBindings; - bool IsStructurallyValid() const - { - if (NativeCaptureRouteShellProfileId.IsEmpty() - || ShellKind.IsEmpty() - || OwnershipSummarySurfaceMode.IsEmpty() - || PreparationSurfaceMode.IsEmpty() - || SessionReopenSurfaceMode.IsEmpty() - || RouteInspectActionId.IsEmpty() - || PreparationRetryActionId.IsEmpty() - || SessionReopenActionId.IsEmpty() - || PermissionDependencyActionId.IsEmpty() - || Panels.Num() <= 0 - || ActionBindings.Num() <= 0) - { - return false; - } - - for (const FHyperTwistSpeechShellPanelLayout& Panel : Panels) - { - if (!Panel.IsStructurallyValid()) - { - return false; - } - } - - for (const FHyperTwistSpeechShellActionBinding& ActionBinding : ActionBindings) - { - if (!ActionBinding.IsStructurallyValid()) - { - return false; - } - } - - return true; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -3815,60 +3309,7 @@ struct FHyperTwistSpeechNativeCaptureRouteShellState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") TArray AvailableActionIds; - bool IsStructurallyValid() const - { - if (NativeCaptureRouteShellProfileId.IsEmpty() - || NativeCaptureRouteWorkflowProfileId.IsEmpty() - || ActiveProviderProfileId.IsEmpty() - || ActiveServiceLaneId.IsEmpty() - || WorkflowStateId.IsEmpty() - || CaptureRouteStateId.IsEmpty() - || PermissionStateId.IsEmpty() - || LatestSourceKind.IsEmpty() - || StatusLine.IsEmpty() - || DetailLine.IsEmpty() - || ActiveIssueCount < 0 - || AvailableActionIds.Num() <= 0) - { - return false; - } - - if (ActiveIssueCount != Issues.Num()) - { - return false; - } - - if (ActiveIssueCount > 0 && !ActiveIssue.IsStructurallyValid()) - { - return false; - } - - for (const FHyperTwistSpeechNativeCaptureRouteWorkflowEntry& Entry : Entries) - { - if (!Entry.IsStructurallyValid()) - { - return false; - } - } - - for (const FHyperTwistSpeechNativeCaptureRouteWorkflowIssue& Issue : Issues) - { - if (!Issue.IsStructurallyValid()) - { - return false; - } - } - - for (const FString& ActionId : AvailableActionIds) - { - if (ActionId.IsEmpty()) - { - return false; - } - } - - return true; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -3918,40 +3359,7 @@ struct FHyperTwistSpeechUsageCostDashboardShellProfile UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") TArray ActionBindings; - bool IsStructurallyValid() const - { - if (DashboardShellProfileId.IsEmpty() - || ShellKind.IsEmpty() - || UsageSurfaceMode.IsEmpty() - || CostSurfaceMode.IsEmpty() - || EscalationBannerMode.IsEmpty() - || RefreshActionId.IsEmpty() - || RouteInspectActionId.IsEmpty() - || BudgetInspectActionId.IsEmpty() - || Panels.Num() <= 0 - || ActionBindings.Num() <= 0) - { - return false; - } - - for (const FHyperTwistSpeechShellPanelLayout& Panel : Panels) - { - if (!Panel.IsStructurallyValid()) - { - return false; - } - } - - for (const FHyperTwistSpeechShellActionBinding& ActionBinding : ActionBindings) - { - if (!ActionBinding.IsStructurallyValid()) - { - return false; - } - } - - return true; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -4106,63 +3514,7 @@ struct FHyperTwistSpeechUsageCostDashboardShellState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") TArray AvailableActionIds; - bool IsStructurallyValid() const - { - if (DashboardShellProfileId.IsEmpty() - || ActiveProviderProfileId.IsEmpty() - || ActiveProviderDisplayLabel.IsEmpty() - || ActiveServiceLaneId.IsEmpty() - || ActiveRouteStateId.IsEmpty() - || UsageAggregationWindowId.IsEmpty() - || CostAggregationWindowId.IsEmpty() - || UsageMeterKind.IsEmpty() - || CurrencyCode.IsEmpty() - || StatusLine.IsEmpty() - || DetailLine.IsEmpty() - || LatestUsageEventId.IsEmpty() - || LatestCostEventId.IsEmpty() - || LatestQuotaStateId.IsEmpty() - || LatestRouteDecisionId.IsEmpty() - || DisplayedUsageQuantity < 0.0f - || DisplayedEstimatedCostUsd < 0.0f - || DisplayedReportedCostUsd < 0.0f - || RemainingEstimatedSpendUsd < 0.0f - || RemainingRequestCount < 0 - || RemainingAudioSeconds < 0 - || ActiveIssueCount < 0 - || AvailableActionIds.Num() <= 0) - { - return false; - } - - if (ActiveIssueCount != Issues.Num()) - { - return false; - } - - if (ActiveIssueCount > 0 && !ActiveIssue.IsStructurallyValid()) - { - return false; - } - - for (const FHyperTwistSpeechUsageCostDashboardIssue& Issue : Issues) - { - if (!Issue.IsStructurallyValid()) - { - return false; - } - } - - for (const FString& ActionId : AvailableActionIds) - { - if (ActionId.IsEmpty()) - { - return false; - } - } - - return true; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -5805,65 +5157,7 @@ struct FHyperTwistSpeechExternalDictationShellProfile UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") TArray ActionBindings; - bool IsStructurallyValid() const - { - if (ExternalDictationShellProfileId.IsEmpty() - || ShellKind.IsEmpty() - || TranscriptHistorySurfaceMode.IsEmpty() - || OutputRoutingSurfaceMode.IsEmpty() - || PostProcessOverlaySurfaceMode.IsEmpty() - || GlobalHotkeySurfaceMode.IsEmpty() - || InputDeviceSurfaceMode.IsEmpty() - || OutputDeviceSurfaceMode.IsEmpty() - || MuteSurfaceMode.IsEmpty() - || MicrophoneModeSurfaceMode.IsEmpty() - || LocalModelCatalogSurfaceMode.IsEmpty() - || ModelIntegritySurfaceMode.IsEmpty() - || ModelUnloadSurfaceMode.IsEmpty() - || StartCaptureActionId.IsEmpty() - || CancelCaptureActionId.IsEmpty() - || CycleOutputRouteActionId.IsEmpty() - || CopyTranscriptActionId.IsEmpty() - || PasteTranscriptActionId.IsEmpty() - || ScriptDispatchActionId.IsEmpty() - || TogglePostProcessOverlayActionId.IsEmpty() - || ReopenSpeechSessionActionId.IsEmpty() - || RouteInspectActionId.IsEmpty() - || InspectGlobalHotkeyActionId.IsEmpty() - || CycleInputDeviceActionId.IsEmpty() - || CycleOutputDeviceActionId.IsEmpty() - || ToggleMuteWhileRecordingActionId.IsEmpty() - || ToggleMicrophoneModeActionId.IsEmpty() - || InspectLocalModelCatalogActionId.IsEmpty() - || ReviewLocalModelIntegrityActionId.IsEmpty() - || ReviewLocalModelUnloadPolicyActionId.IsEmpty() - || PrimaryHotkeyBindingLabel.IsEmpty() - || PostProcessHotkeyBindingLabel.IsEmpty() - || RetainedHistoryEntryLimit <= 0 - || Panels.Num() <= 0 - || ActionBindings.Num() <= 0) - { - return false; - } - - for (const FHyperTwistSpeechShellPanelLayout& Panel : Panels) - { - if (!Panel.IsStructurallyValid()) - { - return false; - } - } - - for (const FHyperTwistSpeechShellActionBinding& ActionBinding : ActionBindings) - { - if (!ActionBinding.IsStructurallyValid()) - { - return false; - } - } - - return true; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -6535,419 +5829,6 @@ struct FHyperTwistSpeechServiceHealth bool IsStructurallyValid() const; }; -namespace HyperTwistRecognitionTypeValidation -{ - inline bool AreNonEmptyStrings(const TArray& Values) - { - for (const FString& Value : Values) - { - if (Value.IsEmpty()) - { - return false; - } - } - - return true; - } - - template - inline bool AreStructurallyValidEntries(const TArray& Values) - { - for (const TStruct& Value : Values) - { - if (!Value.IsStructurallyValid()) - { - return false; - } - } - - return true; - } - - inline bool AreSpeechModelPayloadsValid(const TArray& Payloads) - { - return AreStructurallyValidEntries(Payloads); - } - - inline bool HasValidSpeechSessionCore(const FHyperTwistSpeechSessionConfig& Session) - { - return !Session.SessionId.IsEmpty() - && !Session.ListeningContractId.IsEmpty() - && !Session.InputRouteId.IsEmpty() - && !Session.AudioEncoding.IsEmpty() - && Session.SampleRateHz > 0 - && Session.ChannelCount > 0 - && !Session.TaskKind.IsEmpty() - && Session.RequiredModelPayloads.Num() > 0 - && Session.VadPolicy.IsStructurallyValid() - && Session.OrchestrationProfile.IsStructurallyValid(); - } - - inline bool HasValidSpeechSessionProfiles(const FHyperTwistSpeechSessionConfig& Session) - { - return !Session.MicrophoneShellProfileId.IsEmpty() - && Session.MicrophoneShellProfileDefinition.IsStructurallyValid() - && !Session.DevicePermissionWorkflowProfileId.IsEmpty() - && Session.DevicePermissionWorkflowProfileDefinition.IsStructurallyValid() - && !Session.NativeCaptureRouteWorkflowProfileId.IsEmpty() - && Session.NativeCaptureRouteWorkflowProfileDefinition.IsStructurallyValid() - && !Session.NativeCaptureRouteShellProfileId.IsEmpty() - && Session.NativeCaptureRouteShellProfileDefinition.IsStructurallyValid() - && !Session.ExternalDictationShellProfileId.IsEmpty() - && Session.ExternalDictationShellProfileDefinition.IsStructurallyValid() - && !Session.ProviderProfileId.IsEmpty() - && Session.ProviderProfileDefinition.IsStructurallyValid() - && !Session.ByokCustodyProfileId.IsEmpty() - && Session.ByokCustodyProfileDefinition.IsStructurallyValid() - && !Session.ProviderRoutingPolicyId.IsEmpty() - && Session.ProviderRoutingPolicyDefinition.IsStructurallyValid() - && Session.ProviderRouteDecision.IsStructurallyValid() - && !Session.UsageCostAccountingProfileId.IsEmpty() - && Session.UsageCostAccountingProfileDefinition.IsStructurallyValid() - && Session.UsageEventTemplate.IsStructurallyValid() - && Session.CostEventTemplate.IsStructurallyValid() - && !Session.UsageCostDashboardShellProfileId.IsEmpty() - && Session.UsageCostDashboardShellProfileDefinition.IsStructurallyValid() - && !Session.UsageCostHistoryExportShellProfileId.IsEmpty() - && Session.UsageCostHistoryExportShellProfileDefinition.IsStructurallyValid() - && !Session.ProviderReceiptReviewShellProfileId.IsEmpty() - && Session.ProviderReceiptReviewShellProfileDefinition.IsStructurallyValid() - && !Session.ProviderBillingSettlementShellProfileId.IsEmpty() - && Session.ProviderBillingSettlementShellProfileDefinition.IsStructurallyValid() - && !Session.ProviderSettlementExceptionShellProfileId.IsEmpty() - && Session.ProviderSettlementExceptionShellProfileDefinition.IsStructurallyValid() - && !Session.PayloadCustodyProfileId.IsEmpty() - && Session.PayloadCustodyProfileDefinition.IsStructurallyValid(); - } - - inline bool HasValidTranscriptCore(const FHyperTwistSpeechTranscriptResult& Transcript) - { - return !Transcript.SessionId.IsEmpty() - && !Transcript.UtteranceId.IsEmpty() - && !Transcript.TaskKind.IsEmpty() - && (!Transcript.TranscriptText.IsEmpty() || Transcript.Segments.Num() > 0) - && !Transcript.OrchestrationProfileId.IsEmpty() - && !Transcript.ServiceLaneId.IsEmpty() - && Transcript.RequestedBatchSize > 0 - && Transcript.ProcessedClipCount > 0 - && Transcript.AppliedBatchCollectionWindowMs > 0 - && Transcript.LanguageProbability >= 0.0f - && !Transcript.AppliedPromptRoutingModeId.IsEmpty() - && !Transcript.AppliedRetrievalContextLaneId.IsEmpty(); - } - - inline bool AreTranscriptSegmentsValid(const TArray& Segments) - { - return AreStructurallyValidEntries(Segments); - } - - inline bool HasValidSpeechServiceHealthCore(const FHyperTwistSpeechServiceHealth& Health) - { - return !Health.ProviderLabel.IsEmpty() - && !Health.ServiceVersion.IsEmpty() - && !Health.ProviderProfileId.IsEmpty() - && Health.ProviderProfileDefinition.IsStructurallyValid() - && !Health.ByokCustodyProfileId.IsEmpty() - && Health.ByokCustodyProfileDefinition.IsStructurallyValid() - && !Health.ProviderRoutingPolicyId.IsEmpty() - && Health.ProviderRoutingPolicyDefinition.IsStructurallyValid() - && Health.ProviderRouteDecision.IsStructurallyValid() - && !Health.UsageCostAccountingProfileId.IsEmpty() - && Health.UsageCostAccountingProfileDefinition.IsStructurallyValid() - && Health.LatestUsageEvent.IsStructurallyValid() - && Health.LatestCostEvent.IsStructurallyValid() - && Health.QuotaRateLimitState.IsStructurallyValid() - && !Health.PayloadCustodyProfileId.IsEmpty() - && Health.PayloadCustodyProfileDefinition.IsStructurallyValid(); - } - - inline bool HasValidExternalDictationShellStateCore( - const FHyperTwistSpeechExternalDictationShellState& State - ) - { - return !State.ExternalDictationShellProfileId.IsEmpty() - && !State.ActiveProviderProfileId.IsEmpty() - && !State.ActiveServiceLaneId.IsEmpty() - && !State.SelectedOutputRouteId.IsEmpty() - && !State.TranscriptHistorySurfaceModeId.IsEmpty() - && !State.OutputRoutingSurfaceModeId.IsEmpty() - && !State.PostProcessOverlaySurfaceModeId.IsEmpty() - && !State.GlobalHotkeySurfaceModeId.IsEmpty() - && !State.InputDeviceSurfaceModeId.IsEmpty() - && !State.OutputDeviceSurfaceModeId.IsEmpty() - && !State.MuteSurfaceModeId.IsEmpty() - && !State.MicrophoneModeSurfaceModeId.IsEmpty() - && !State.LocalModelCatalogSurfaceModeId.IsEmpty() - && !State.ModelIntegritySurfaceModeId.IsEmpty() - && !State.ModelUnloadSurfaceModeId.IsEmpty() - && !State.LatestSourceKind.IsEmpty() - && !State.StatusLine.IsEmpty() - && !State.DetailLine.IsEmpty() - && !State.PrimaryHotkeyBindingLabel.IsEmpty() - && !State.PostProcessHotkeyBindingLabel.IsEmpty() - && !State.SelectedInputDeviceId.IsEmpty() - && !State.SelectedInputDeviceLabel.IsEmpty() - && !State.SelectedOutputDeviceId.IsEmpty() - && !State.SelectedOutputDeviceLabel.IsEmpty() - && !State.MicrophoneModeId.IsEmpty() - && !State.PayloadCustodyProfileId.IsEmpty() - && !State.SelectedPrimaryPayloadId.IsEmpty() - && State.HistoryEntryCount >= 0 - && State.PostProcessedEntryCount >= 0 - && State.SavedEntryCount >= 0 - && State.ModelCatalogEntryCount >= 0 - && State.OptionalModelCatalogEntryCount >= 0 - && State.DownloadDeferredModelEntryCount >= 0 - && State.IntegrityReviewRequiredEntryCount >= 0 - && State.ActiveIssueCount >= 0 - && State.OutputRouteOptions.Num() > 0 - && State.InputDeviceOptions.Num() > 0 - && State.OutputDeviceOptions.Num() > 0 - && State.ModelCatalogEntries.Num() > 0 - && State.AvailableActionIds.Num() > 0; - } - - inline bool HasConsistentExternalDictationShellStateCounts( - const FHyperTwistSpeechExternalDictationShellState& State - ) - { - return State.HistoryEntryCount == State.HistoryEntries.Num() - && State.PostProcessedEntryCount <= State.HistoryEntryCount - && State.SavedEntryCount <= State.HistoryEntryCount - && State.ModelCatalogEntryCount == State.ModelCatalogEntries.Num() - && State.OptionalModelCatalogEntryCount <= State.ModelCatalogEntryCount - && State.DownloadDeferredModelEntryCount <= State.ModelCatalogEntryCount - && State.IntegrityReviewRequiredEntryCount <= State.ModelCatalogEntryCount; - } - - inline bool HasConsistentExternalDictationShellStateLatestEntry( - const FHyperTwistSpeechExternalDictationShellState& State - ) - { - return State.HistoryEntryCount <= 0 - || (!State.LatestHistoryEntryId.IsEmpty() && !State.LatestTranscriptText.IsEmpty()); - } - - inline bool HasConsistentExternalDictationShellStateActiveIssue( - const FHyperTwistSpeechExternalDictationShellState& State - ) - { - return State.ActiveIssueCount == State.Issues.Num() - && (State.ActiveIssueCount <= 0 || State.ActiveIssue.IsStructurallyValid()); - } -} - -inline bool FHyperTwistSpeechUsageCostHistoryExportShellState::IsStructurallyValid() const -{ - if (HistoryExportShellProfileId.IsEmpty() - || ActiveProviderProfileId.IsEmpty() - || ActiveProviderDisplayLabel.IsEmpty() - || ActiveServiceLaneId.IsEmpty() - || SelectedHistoryWindowId.IsEmpty() - || ExportPreviewFormatId.IsEmpty() - || LatestSourceKind.IsEmpty() - || StatusLine.IsEmpty() - || DetailLine.IsEmpty() - || HistoryEntryCount < 0 - || EstimateOnlyEntryCount < 0 - || ProviderReceiptEntryCount < 0 - || TotalUsageQuantity < 0.0f - || TotalEstimatedCostUsd < 0.0f - || TotalReportedCostUsd < 0.0f - || LowestRemainingEstimatedSpendUsd < 0.0f - || ActiveIssueCount < 0 - || AvailableActionIds.Num() <= 0) - { - return false; - } - - return HistoryEntryCount == HistoryEntries.Num() - && (HistoryEntryCount <= 0 || !LatestHistoryEntryId.IsEmpty()) - && (!bExportPreviewReady || !ExportPreviewText.IsEmpty()) - && ActiveIssueCount == Issues.Num() - && (ActiveIssueCount <= 0 || ActiveIssue.IsStructurallyValid()) - && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(Issues) - && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(HistoryEntries) - && HyperTwistRecognitionTypeValidation::AreNonEmptyStrings(AvailableActionIds); -} - -inline bool FHyperTwistSpeechProviderReceiptReviewShellState::IsStructurallyValid() const -{ - if (ReceiptReviewShellProfileId.IsEmpty() - || ActiveProviderProfileId.IsEmpty() - || ActiveProviderDisplayLabel.IsEmpty() - || ActiveServiceLaneId.IsEmpty() - || SelectedChargeWindowId.IsEmpty() - || PostedChargeInspectionModeId.IsEmpty() - || LatestSourceKind.IsEmpty() - || StatusLine.IsEmpty() - || DetailLine.IsEmpty() - || ReceiptEntryCount < 0 - || ProviderPostedChargeCount < 0 - || EstimateOnlyEntryCount < 0 - || VarianceReviewEntryCount < 0 - || TotalEstimatedCostUsd < 0.0f - || TotalReportedCostUsd < 0.0f - || TotalAbsoluteVarianceUsd < 0.0f - || HighestAbsoluteVarianceUsd < 0.0f - || ActiveIssueCount < 0 - || AvailableActionIds.Num() <= 0) - { - return false; - } - - return ReceiptEntryCount == ReceiptEntries.Num() - && ProviderPostedChargeCount <= ReceiptEntryCount - && EstimateOnlyEntryCount <= ReceiptEntryCount - && VarianceReviewEntryCount <= ReceiptEntryCount - && (ReceiptEntryCount <= 0 || !LatestReceiptEntryId.IsEmpty()) - && (!bReceiptSummaryReady || !ReceiptSummaryText.IsEmpty()) - && ActiveIssueCount == Issues.Num() - && (ActiveIssueCount <= 0 || ActiveIssue.IsStructurallyValid()) - && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(Issues) - && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(ReceiptEntries) - && HyperTwistRecognitionTypeValidation::AreNonEmptyStrings(AvailableActionIds); -} - -inline bool FHyperTwistSpeechProviderBillingSettlementShellState::IsStructurallyValid() const -{ - if (BillingSettlementShellProfileId.IsEmpty() - || ActiveProviderProfileId.IsEmpty() - || ActiveProviderDisplayLabel.IsEmpty() - || ActiveServiceLaneId.IsEmpty() - || SelectedSettlementWindowId.IsEmpty() - || SettlementSurfaceModeId.IsEmpty() - || InvoiceReconciliationModeId.IsEmpty() - || LatestSourceKind.IsEmpty() - || StatusLine.IsEmpty() - || DetailLine.IsEmpty() - || SettlementEntryCount < 0 - || ProviderPostedChargeCount < 0 - || ReconciliationReadyEntryCount < 0 - || EstimateOnlyEntryCount < 0 - || ManualReviewEntryCount < 0 - || BlockedSettlementEntryCount < 0 - || TotalEstimatedCostUsd < 0.0f - || TotalReportedCostUsd < 0.0f - || TotalSettlementDeltaUsd < 0.0f - || HighestSettlementDeltaUsd < 0.0f - || ActiveIssueCount < 0 - || AvailableActionIds.Num() <= 0) - { - return false; - } - - return SettlementEntryCount == SettlementEntries.Num() - && ProviderPostedChargeCount <= SettlementEntryCount - && ReconciliationReadyEntryCount <= SettlementEntryCount - && EstimateOnlyEntryCount <= SettlementEntryCount - && ManualReviewEntryCount <= SettlementEntryCount - && BlockedSettlementEntryCount <= SettlementEntryCount - && (SettlementEntryCount <= 0 || !LatestSettlementEntryId.IsEmpty()) - && (!bSettlementSummaryReady || !SettlementSummaryText.IsEmpty()) - && ActiveIssueCount == Issues.Num() - && (ActiveIssueCount <= 0 || ActiveIssue.IsStructurallyValid()) - && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(Issues) - && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(SettlementEntries) - && HyperTwistRecognitionTypeValidation::AreNonEmptyStrings(AvailableActionIds); -} - -inline bool FHyperTwistSpeechProviderSettlementExceptionShellState::IsStructurallyValid() const -{ - if (SettlementExceptionShellProfileId.IsEmpty() - || ActiveProviderProfileId.IsEmpty() - || ActiveProviderDisplayLabel.IsEmpty() - || ActiveServiceLaneId.IsEmpty() - || SelectedSettlementWindowId.IsEmpty() - || ExceptionSurfaceModeId.IsEmpty() - || ExternalPortalHandoffModeId.IsEmpty() - || LatestSourceKind.IsEmpty() - || StatusLine.IsEmpty() - || DetailLine.IsEmpty() - || ExceptionEntryCount < 0 - || ExternalPortalHandoffReadyEntryCount < 0 - || PendingChargeEntryCount < 0 - || ManualReviewEntryCount < 0 - || RouteDegradedEntryCount < 0 - || BlockedSettlementEntryCount < 0 - || TotalEstimatedCostUsd < 0.0f - || TotalReportedCostUsd < 0.0f - || TotalSettlementDeltaUsd < 0.0f - || HighestSettlementDeltaUsd < 0.0f - || ActiveIssueCount < 0 - || AvailableActionIds.Num() <= 0) - { - return false; - } - - return ExceptionEntryCount == ExceptionEntries.Num() - && ExternalPortalHandoffReadyEntryCount <= ExceptionEntryCount - && PendingChargeEntryCount <= ExceptionEntryCount - && ManualReviewEntryCount <= ExceptionEntryCount - && RouteDegradedEntryCount <= ExceptionEntryCount - && BlockedSettlementEntryCount <= ExceptionEntryCount - && (ExceptionEntryCount <= 0 || !LatestExceptionEntryId.IsEmpty()) - && (!bExceptionSummaryReady || !ExceptionSummaryText.IsEmpty()) - && ActiveIssueCount == Issues.Num() - && (ActiveIssueCount <= 0 || ActiveIssue.IsStructurallyValid()) - && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(Issues) - && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(ExceptionEntries) - && HyperTwistRecognitionTypeValidation::AreNonEmptyStrings(AvailableActionIds); -} - -inline bool FHyperTwistSpeechExternalDictationShellState::IsStructurallyValid() const -{ - return HyperTwistRecognitionTypeValidation::HasValidExternalDictationShellStateCore(*this) - && HyperTwistRecognitionTypeValidation::HasConsistentExternalDictationShellStateCounts( - *this - ) - && HyperTwistRecognitionTypeValidation::HasConsistentExternalDictationShellStateLatestEntry( - *this - ) - && HyperTwistRecognitionTypeValidation::HasConsistentExternalDictationShellStateActiveIssue( - *this - ) - && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(Issues) - && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(HistoryEntries) - && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(OutputRouteOptions) - && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(InputDeviceOptions) - && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(OutputDeviceOptions) - && HyperTwistRecognitionTypeValidation::AreStructurallyValidEntries(ModelCatalogEntries) - && HyperTwistRecognitionTypeValidation::AreNonEmptyStrings(AvailableActionIds); -} - -inline bool FHyperTwistSpeechSessionConfig::IsStructurallyValid() const -{ - return HyperTwistRecognitionTypeValidation::HasValidSpeechSessionCore(*this) - && HyperTwistRecognitionTypeValidation::HasValidSpeechSessionProfiles(*this) - && HyperTwistRecognitionTypeValidation::AreSpeechModelPayloadsValid(RequiredModelPayloads); -} - -inline bool FHyperTwistSpeechTranscriptResult::IsStructurallyValid() const -{ - if (!HyperTwistRecognitionTypeValidation::HasValidTranscriptCore(*this) - || RetrievedHintCount < 0) - { - return false; - } - - if (bUsedRetrievedHintAugmentation && RetrievedHintCount <= 0) - { - return false; - } - - return RetrievedHintCount == AppliedRetrievedHints.Num() - && HyperTwistRecognitionTypeValidation::AreTranscriptSegmentsValid(Segments) - && HyperTwistRecognitionTypeValidation::AreNonEmptyStrings(AppliedRetrievedHints); -} - -inline bool FHyperTwistSpeechServiceHealth::IsStructurallyValid() const -{ - return HyperTwistRecognitionTypeValidation::HasValidSpeechServiceHealthCore(*this) - && HyperTwistRecognitionTypeValidation::AreNonEmptyStrings(SupportedModelPayloadIds) - && HyperTwistRecognitionTypeValidation::AreSpeechModelPayloadsValid(SupportedModelPayloads); -} - USTRUCT(BlueprintType) struct FHyperTwistVoiceAssetDescriptor { @@ -6989,18 +5870,7 @@ struct FHyperTwistVoiceAssetDescriptor UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") bool bBundledWithCodeDistribution = false; - bool IsStructurallyValid() const - { - return !VoiceAssetId.IsEmpty() - && !VoiceProfileId.IsEmpty() - && !ArtifactName.IsEmpty() - && !RelativePathHint.IsEmpty() - && !SourceDocumentPath.IsEmpty() - && !ReviewDocumentPath.IsEmpty() - && !AcquisitionMode.IsEmpty() - && !ReviewPosture.IsEmpty() - && ApproximateSizeMiB > 0; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -7044,15 +5914,7 @@ struct FHyperTwistVoiceAssetReviewProfile UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") bool bRequiresPerVoiceModelCardReview = true; - bool IsStructurallyValid() const - { - return !VoiceAssetReviewProfileId.IsEmpty() - && !VoiceAssetReviewPosture.IsEmpty() - && !ShippingPosture.IsEmpty() - && !DownloadWorkflowPosture.IsEmpty() - && !ProvisioningPosture.IsEmpty() - && !CodeLicenseBoundary.IsEmpty(); - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -7096,18 +5958,7 @@ struct FHyperTwistVoiceModelReviewDescriptor UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") bool bBundledWithCodeDistribution = false; - bool IsStructurallyValid() const - { - return !VoiceModelReviewId.IsEmpty() - && !ModelBindingId.IsEmpty() - && !VocoderBindingId.IsEmpty() - && !VoiceProfileId.IsEmpty() - && !RegistryReferencePath.IsEmpty() - && !ReviewDocumentPath.IsEmpty() - && !ModelLicensePosture.IsEmpty() - && !PayloadLicensePosture.IsEmpty() - && !AcquisitionMode.IsEmpty(); - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -7145,14 +5996,7 @@ struct FHyperTwistVoiceModelReviewProfile UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") bool bAllowsRuntimeModelDownloadInCurrentPacket = false; - bool IsStructurallyValid() const - { - return !VoiceModelReviewProfileId.IsEmpty() - && !ReviewPosture.IsEmpty() - && !ShippingPosture.IsEmpty() - && !DownloadWorkflowPosture.IsEmpty() - && !CodeLicenseBoundary.IsEmpty(); - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -7190,17 +6034,7 @@ struct FHyperTwistVoiceProfileSummary UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") TArray Aliases; - bool IsStructurallyValid() const - { - return !VoiceProfileId.IsEmpty() - && !VoiceName.IsEmpty() - && !LanguageCode.IsEmpty() - && !LanguageFamily.IsEmpty() - && !RegionCode.IsEmpty() - && !LanguageNameEnglish.IsEmpty() - && !Quality.IsEmpty() - && NumSpeakers > 0; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -7211,23 +6045,7 @@ struct FHyperTwistVoiceProfileCatalog UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") TArray Profiles; - bool IsStructurallyValid() const - { - if (Profiles.Num() <= 0) - { - return false; - } - - for (const FHyperTwistVoiceProfileSummary& Profile : Profiles) - { - if (!Profile.IsStructurallyValid()) - { - return false; - } - } - - return true; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -7271,14 +6089,7 @@ struct FHyperTwistNarrationOrchestrationProfile UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") bool bPreferGpu = false; - bool IsStructurallyValid() const - { - return !OrchestrationProfileId.IsEmpty() - && !ServiceLaneId.IsEmpty() - && !ModelBindingId.IsEmpty() - && !VocoderBindingId.IsEmpty() - && !DefaultSpeakerProfileId.IsEmpty(); - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -7343,23 +6154,7 @@ struct FHyperTwistNarrationSynthesisRequest UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString AudioEncodingHint = TEXT("wav-pcm16-mono"); - bool IsStructurallyValid() const - { - return !RequestId.IsEmpty() - && !NarrationContractId.IsEmpty() - && !ServiceLaneId.IsEmpty() - && !OutputRouteId.IsEmpty() - && !VoiceProfileId.IsEmpty() - && !LanguageCode.IsEmpty() - && OrchestrationProfile.IsStructurallyValid() - && ServiceLaneId.Equals(OrchestrationProfile.ServiceLaneId, ESearchCase::CaseSensitive) - && !ScriptText.IsEmpty() - && !AudioEncodingHint.IsEmpty() - && LengthScale > 0.0f - && NoiseScale >= 0.0f - && NoiseW >= 0.0f - && SentenceSilenceSeconds >= 0.0f; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -7439,28 +6234,7 @@ struct FHyperTwistNarrationSynthesisResult UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") TArray Warnings; - bool IsStructurallyValid() const - { - return !RequestId.IsEmpty() - && !NarrationContractId.IsEmpty() - && !ServiceLaneId.IsEmpty() - && !OutputRouteId.IsEmpty() - && !VoiceProfileId.IsEmpty() - && !LanguageCode.IsEmpty() - && !OrchestrationProfileId.IsEmpty() - && !ModelBindingId.IsEmpty() - && !VocoderBindingId.IsEmpty() - && !SubtitleText.IsEmpty() - && !AudioEncoding.IsEmpty() - && SampleRateHz > 0 - && ChannelCount > 0 - && DurationMs >= 0 - && AudioBytes.Num() > 0 - && AppliedLengthScale > 0.0f - && AppliedNoiseScale >= 0.0f - && AppliedNoiseW >= 0.0f - && AppliedSentenceSilenceSeconds >= 0.0f; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -7522,71 +6296,5 @@ struct FHyperTwistVoiceServiceHealth UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") bool bReady = true; - bool IsStructurallyValid() const - { - if (ProviderLabel.IsEmpty() || ServiceVersion.IsEmpty()) - { - return false; - } - - if (!VoiceAssetReviewProfileId.IsEmpty() - || VoiceAssetReviewProfileDefinition.IsStructurallyValid() - || SupportedVoiceAssetIds.Num() > 0 - || SupportedVoiceAssets.Num() > 0) - { - if (VoiceAssetReviewProfileId.IsEmpty() - || !VoiceAssetReviewProfileDefinition.IsStructurallyValid() - || SupportedVoiceAssetIds.Num() != SupportedVoiceAssets.Num()) - { - return false; - } - } - - for (const FString& VoiceAssetId : SupportedVoiceAssetIds) - { - if (VoiceAssetId.IsEmpty()) - { - return false; - } - } - - for (const FHyperTwistVoiceAssetDescriptor& VoiceAsset : SupportedVoiceAssets) - { - if (!VoiceAsset.IsStructurallyValid()) - { - return false; - } - } - - if (!VoiceModelReviewProfileId.IsEmpty() - || VoiceModelReviewProfileDefinition.IsStructurallyValid() - || SupportedVoiceModelReviewIds.Num() > 0 - || SupportedVoiceModelReviews.Num() > 0) - { - if (VoiceModelReviewProfileId.IsEmpty() - || !VoiceModelReviewProfileDefinition.IsStructurallyValid() - || SupportedVoiceModelReviewIds.Num() != SupportedVoiceModelReviews.Num()) - { - return false; - } - } - - for (const FString& ReviewId : SupportedVoiceModelReviewIds) - { - if (ReviewId.IsEmpty()) - { - return false; - } - } - - for (const FHyperTwistVoiceModelReviewDescriptor& Review : SupportedVoiceModelReviews) - { - if (!Review.IsStructurallyValid()) - { - return false; - } - } - - return true; - } + bool IsStructurallyValid() const; }; diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistSkills/HyperTwistSkillTypes.h b/UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistSkills/HyperTwistSkillTypes.h index 2ccaa75..b8c0876 100644 --- a/UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistSkills/HyperTwistSkillTypes.h +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistSkills/HyperTwistSkillTypes.h @@ -363,97 +363,7 @@ struct FHyperTwistSkillRegistryState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (RegistryId.IsEmpty() - || ManifestVersion.IsEmpty() - || ReferenceUtc.IsEmpty() - || CommandSurfaceRootId.IsEmpty() - || Entries.Num() == 0 - || SkillCount != Entries.Num() - || !bAllSkillsOptionalAssistive - || !bDisabledSkillsRemainInstalled - || !bDisabledSkillsAreInert - || !bNoAdHocMetadataRequired) - { - return false; - } - - TArray SeenSkillIds; - int32 ComputedEnabledByDefaultCount = 0; - bool bComputedAllOptionalAssistive = true; - bool bComputedDisabledRemainInstalled = true; - bool bComputedDisabledAreInert = true; - - for (const FHyperTwistSkillManifestEntry& Entry : Entries) - { - if (!Entry.IsStructurallyValid() || SeenSkillIds.Contains(Entry.SkillId)) - { - return false; - } - - SeenSkillIds.Add(Entry.SkillId); - ComputedEnabledByDefaultCount += Entry.bEnabledByDefault ? 1 : 0; - bComputedAllOptionalAssistive &= Entry.bOptionalAssistive; - bComputedDisabledRemainInstalled &= Entry.bInstalledWhenDisabled; - bComputedDisabledAreInert &= Entry.bInertWhenDisabled; - } - - if (EnabledByDefaultCount != ComputedEnabledByDefaultCount - || DisabledByDefaultCount != (Entries.Num() - ComputedEnabledByDefaultCount) - || bAllSkillsOptionalAssistive != bComputedAllOptionalAssistive - || bDisabledSkillsRemainInstalled != bComputedDisabledRemainInstalled - || bDisabledSkillsAreInert != bComputedDisabledAreInert) - { - return false; - } - - TArray SeenStatuses; - for (const FHyperTwistSkillStatusCount& StatusCount : StatusCounts) - { - if (!StatusCount.IsStructurallyValid() || SeenStatuses.Contains(StatusCount.Status)) - { - return false; - } - - int32 ComputedCount = 0; - for (const FHyperTwistSkillManifestEntry& Entry : Entries) - { - ComputedCount += Entry.Status == StatusCount.Status ? 1 : 0; - } - - if (ComputedCount != StatusCount.Count) - { - return false; - } - - SeenStatuses.Add(StatusCount.Status); - } - - TArray SeenFamilies; - for (const FHyperTwistSkillFamilyCount& FamilyCount : FamilyCounts) - { - if (!FamilyCount.IsStructurallyValid() || SeenFamilies.Contains(FamilyCount.Family)) - { - return false; - } - - int32 ComputedCount = 0; - for (const FHyperTwistSkillManifestEntry& Entry : Entries) - { - ComputedCount += Entry.Family == FamilyCount.Family ? 1 : 0; - } - - if (ComputedCount != FamilyCount.Count) - { - return false; - } - - SeenFamilies.Add(FamilyCount.Family); - } - - return true; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -746,92 +656,7 @@ struct FHyperTwistSkillControlState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (RegistryId.IsEmpty() - || ManifestVersion.IsEmpty() - || ReferenceUtc.IsEmpty() - || CommandSurfaceRootId.IsEmpty() - || ControlProfileId.IsEmpty() - || !MasterSwitch.IsStructurallyValid() - || SkillStates.Num() == 0 - || SkillCount != SkillStates.Num() - || EffectiveDisabledSkillCount != (SkillCount - EffectiveEnabledSkillCount) - || HiddenSkillCount != (SkillCount - VisibleSkillCount) - || !bCoreProductWorksWithAllSkillsOff - || !bNoPromptBabysittingToDisable - || !bAllInstalledSkillsRemainReenableable) - { - return false; - } - - TArray SeenSkillIds; - int32 ComputedEnabledCount = 0; - int32 ComputedVisibleCount = 0; - bool bComputedNoBabysitting = true; - bool bComputedReenableable = true; - for (const FHyperTwistSkillControlStateEntry& SkillState : SkillStates) - { - if (!SkillState.IsStructurallyValid() || SeenSkillIds.Contains(SkillState.SkillId)) - { - return false; - } - - SeenSkillIds.Add(SkillState.SkillId); - ComputedEnabledCount += SkillState.bEffectiveEnabled ? 1 : 0; - ComputedVisibleCount += SkillState.bEffectiveVisible ? 1 : 0; - bComputedNoBabysitting &= SkillState.bDurableSettingExposed; - bComputedReenableable &= SkillState.bInstalled && SkillState.bInertWhenDisabled; - } - - if (ComputedEnabledCount != EffectiveEnabledSkillCount - || ComputedVisibleCount != VisibleSkillCount - || bComputedNoBabysitting != bNoPromptBabysittingToDisable - || bComputedReenableable != bAllInstalledSkillsRemainReenableable) - { - return false; - } - - TArray SeenGroupIds; - for (const FHyperTwistSkillVisibilityGroupState& Group : VisibilityGroups) - { - if (!Group.IsStructurallyValid() || SeenGroupIds.Contains(Group.GroupId)) - { - return false; - } - - int32 ComputedGroupVisibleCount = 0; - int32 ComputedGroupHiddenCount = 0; - for (const FString& SkillId : Group.SkillIds) - { - const FHyperTwistSkillControlStateEntry* SkillState = SkillStates.FindByPredicate( - [&SkillId](const FHyperTwistSkillControlStateEntry& Entry) - { - return Entry.SkillId == SkillId; - } - ); - if (SkillState == nullptr - || SkillState->Family != Group.Family - || SkillState->VisibilityGroupId != Group.GroupId) - { - return false; - } - - ComputedGroupVisibleCount += SkillState->bEffectiveVisible ? 1 : 0; - ComputedGroupHiddenCount += SkillState->bEffectiveVisible ? 0 : 1; - } - - if (ComputedGroupVisibleCount != Group.VisibleSkillCount - || ComputedGroupHiddenCount != Group.HiddenSkillCount) - { - return false; - } - - SeenGroupIds.Add(Group.GroupId); - } - - return true; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -1161,83 +986,7 @@ struct FHyperTwistSkillAuditLedgerState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (RegistryId.IsEmpty() - || ManifestVersion.IsEmpty() - || ReferenceUtc.IsEmpty() - || CommandSurfaceRootId.IsEmpty() - || ControlProfileId.IsEmpty() - || LedgerId.IsEmpty() - || InvocationCount != InvocationRecords.Num() - || EnabledSkillCount < 0 - || InvocationCount < 0 - || SuccessfulInvocationCount < 0 - || FailedInvocationCount < 0 - || CancelledInvocationCount < 0 - || TraceableInvocationCount < 0 - || ProductTruthOutputCount < 0 - || TraceableProductTruthOutputCount < 0 - || !bNoUntraceableProductTruth - || !bCommandServiceProvenanceVisible) - { - return false; - } - - TArray SeenInvocationIds; - int32 ComputedSuccessCount = 0; - int32 ComputedFailureCount = 0; - int32 ComputedCancelCount = 0; - int32 ComputedTraceableInvocationCount = 0; - int32 ComputedProductTruthCount = 0; - int32 ComputedTraceableProductTruthCount = 0; - bool bComputedCommandProvenanceVisible = true; - for (const FHyperTwistSkillInvocationRecord& Record : InvocationRecords) - { - if (!Record.IsStructurallyValid() || SeenInvocationIds.Contains(Record.InvocationId)) - { - return false; - } - - SeenInvocationIds.Add(Record.InvocationId); - ComputedTraceableInvocationCount += Record.bInvocationTraceable ? 1 : 0; - ComputedProductTruthCount += Record.bOutputBecameProductTruth ? 1 : 0; - ComputedTraceableProductTruthCount += - (Record.bOutputBecameProductTruth && Record.bOutputTraceable) ? 1 : 0; - bComputedCommandProvenanceVisible &= Record.CommandProvenance.bCommandBindingDeclared - && Record.CommandProvenance.bServiceBindingVisible; - - switch (Record.Outcome) - { - case EHyperTwistSkillInvocationOutcome::Succeeded: - ComputedSuccessCount += 1; - break; - - case EHyperTwistSkillInvocationOutcome::Failed: - ComputedFailureCount += 1; - break; - - case EHyperTwistSkillInvocationOutcome::Cancelled: - ComputedCancelCount += 1; - break; - - default: - return false; - } - } - - return SuccessfulInvocationCount == ComputedSuccessCount - && FailedInvocationCount == ComputedFailureCount - && CancelledInvocationCount == ComputedCancelCount - && TraceableInvocationCount == ComputedTraceableInvocationCount - && ProductTruthOutputCount == ComputedProductTruthCount - && TraceableProductTruthOutputCount == ComputedTraceableProductTruthCount - && bNoUntraceableProductTruth - == (ComputedProductTruthCount == ComputedTraceableProductTruthCount) - && bFailureRecordingSupported - && bCancelRecordingSupported - && bCommandServiceProvenanceVisible == bComputedCommandProvenanceVisible; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -1516,113 +1265,7 @@ struct FHyperTwistSkillAuthoringHarnessState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (RegistryId.IsEmpty() - || ManifestVersion.IsEmpty() - || ReferenceUtc.IsEmpty() - || CommandSurfaceRootId.IsEmpty() - || AuditLedgerId.IsEmpty() - || TemplateVersion.IsEmpty() - || TemplateSections.Num() == 0 - || Examples.Num() == 0 - || ValidationCases.Num() == 0 - || SkillCount <= 0 - || ExampleCount != Examples.Num() - || ValidationCaseCount != ValidationCases.Num() - || SkillsWithSmokeContractCount < 0 - || SkillsWithEvalContractCount < 0 - || !bNewSkillsCanBeAddedWithoutInventingStructure - || !bEverySkillHasSmokeContract - || !bEverySkillHasEvalContract - || !bExamplesGroundedInFirstPartyRegistry - || !bValidationHarnessUsesAuditLedgerWhenLive) - { - return false; - } - - TArray SeenSectionIds; - for (const FHyperTwistSkillAuthoringTemplateSection& Section : TemplateSections) - { - if (!Section.IsStructurallyValid() || SeenSectionIds.Contains(Section.SectionId)) - { - return false; - } - - SeenSectionIds.Add(Section.SectionId); - } - - TArray SeenExampleIds; - TArray ExampleSkillIds; - bool bComputedExamplesGroundedInRegistry = true; - for (const FHyperTwistSkillAuthoringExampleState& Example : Examples) - { - if (!Example.IsStructurallyValid() || SeenExampleIds.Contains(Example.ExampleId)) - { - return false; - } - - for (const FString& SectionId : Example.TemplateSectionIds) - { - if (!SeenSectionIds.Contains(SectionId)) - { - return false; - } - } - - SeenExampleIds.Add(Example.ExampleId); - ExampleSkillIds.Add(Example.SkillId); - bComputedExamplesGroundedInRegistry &= Example.bGroundedInRegistry; - } - - TArray SeenCaseIds; - TArray SkillsWithSmokeContract; - TArray SkillsWithEvalContract; - bool bComputedValidationUsesAuditLedgerWhenLive = true; - for (const FHyperTwistSkillValidationContractCase& ValidationCase : ValidationCases) - { - if (!ValidationCase.IsStructurallyValid() || SeenCaseIds.Contains(ValidationCase.CaseId)) - { - return false; - } - - if (!ExampleSkillIds.Contains(ValidationCase.SkillId)) - { - return false; - } - - for (const FString& SectionId : ValidationCase.RequiredTemplateSectionIds) - { - if (!SeenSectionIds.Contains(SectionId)) - { - return false; - } - } - - if (ValidationCase.Kind == EHyperTwistSkillValidationContractKind::Smoke) - { - SkillsWithSmokeContract.AddUnique(ValidationCase.SkillId); - } - else if (ValidationCase.Kind == EHyperTwistSkillValidationContractKind::Eval) - { - SkillsWithEvalContract.AddUnique(ValidationCase.SkillId); - } - - bComputedValidationUsesAuditLedgerWhenLive &= - ValidationCase.ExecutionMode != EHyperTwistSkillValidationExecutionMode::LiveContract - || ValidationCase.bUsesAuditLedgerEvidence; - - SeenCaseIds.Add(ValidationCase.CaseId); - } - - return SkillsWithSmokeContractCount == SkillsWithSmokeContract.Num() - && SkillsWithEvalContractCount == SkillsWithEvalContract.Num() - && SkillsWithSmokeContractCount == SkillCount - && SkillsWithEvalContractCount == SkillCount - && bExamplesGroundedInFirstPartyRegistry == bComputedExamplesGroundedInRegistry - && bValidationHarnessUsesAuditLedgerWhenLive - == bComputedValidationUsesAuditLedgerWhenLive; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -3328,79 +2971,7 @@ struct FHyperTwistSkillExtractionSkill UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (SkillId.IsEmpty() - || DisplayLabel.IsEmpty() - || CommandSurfaceId.IsEmpty() - || ServiceBindingId.IsEmpty() - || OwnerLaneId.IsEmpty() - || OwnerFeatureId.IsEmpty() - || Status == EHyperTwistSkillStatus::None - || PermissionScopeIds.Num() == 0 - || SourceSurfaceIds.Num() == 0 - || StructuredFieldIds.Num() == 0 - || OutputArtifactKinds.Num() == 0 - || PreviewHeadlines.Num() == 0 - || SourceSurfaceCount != SourceSurfaceIds.Num() - || StructuredFieldCount != StructuredFieldIds.Num() - || !bReadsAuthoritativeSourceSurfaces - || !bPreservesOptionalAssistiveOffState - || !bDerivedAssistiveOnly - || !bHasValidationHarnessCoverage - || !bStructuredExtractionOnly - || !bAvoidsBrowserDiagnosticsWidening - || !bAvoidsDesignTranslationWidening - || bExtractsDocumentation == bExtractsDesignSpecs) - { - return false; - } - - for (const FString& Value : PermissionScopeIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : SourceSurfaceIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : StructuredFieldIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : OutputArtifactKinds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : PreviewHeadlines) - { - if (Value.IsEmpty()) - { - return false; - } - } - - return Status == EHyperTwistSkillStatus::ImplementedNow - && bLiveSkill - && bAvailableNow - && !bRequiresOwnerActivation; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -3462,83 +3033,7 @@ struct FHyperTwistSkillExtractionState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (RegistryId.IsEmpty() - || ManifestVersion.IsEmpty() - || ReferenceUtc.IsEmpty() - || CommandSurfaceRootId.IsEmpty() - || TemplateVersion.IsEmpty() - || Skills.Num() == 0 - || SkillCount != Skills.Num() - || !bEveryLiveSkillReadsAuthoritativeSourceSurfaces - || !bEverySkillPreservesOptionalAssistiveOffState - || !bEveryLiveSkillHasValidationHarnessCoverage - || !bStructuredExtractionRemainsBounded - || !bNoBrowserDiagnosticsWidening - || !bNoDesignTranslationWidening) - { - return false; - } - - TArray SeenSkillIds; - int32 ComputedLiveSkillCount = 0; - int32 ComputedAvailableNowCount = 0; - int32 ComputedDocsExtractionSkillCount = 0; - int32 ComputedDesignSpecExtractionSkillCount = 0; - bool bComputedEveryLiveSkillReadsAuthoritativeSourceSurfaces = true; - bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; - bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; - bool bComputedStructuredExtractionBounded = true; - bool bComputedNoBrowserDiagnosticsWidening = true; - bool bComputedNoDesignTranslationWidening = true; - - for (const FHyperTwistSkillExtractionSkill& Skill : Skills) - { - if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) - { - return false; - } - - SeenSkillIds.Add(Skill.SkillId); - ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; - ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; - ComputedDocsExtractionSkillCount += Skill.bExtractsDocumentation ? 1 : 0; - ComputedDesignSpecExtractionSkillCount += Skill.bExtractsDesignSpecs ? 1 : 0; - bComputedEverySkillPreservesOptionalAssistiveOffState &= - Skill.bPreservesOptionalAssistiveOffState; - bComputedStructuredExtractionBounded &= Skill.bStructuredExtractionOnly; - bComputedNoBrowserDiagnosticsWidening &= - Skill.bAvoidsBrowserDiagnosticsWidening; - bComputedNoDesignTranslationWidening &= - Skill.bAvoidsDesignTranslationWidening; - - if (Skill.bLiveSkill) - { - bComputedEveryLiveSkillReadsAuthoritativeSourceSurfaces &= - Skill.bReadsAuthoritativeSourceSurfaces; - bComputedEveryLiveSkillHasValidationHarnessCoverage &= - Skill.bHasValidationHarnessCoverage; - } - } - - return LiveSkillCount == ComputedLiveSkillCount - && AvailableNowCount == ComputedAvailableNowCount - && DocsExtractionSkillCount == ComputedDocsExtractionSkillCount - && DesignSpecExtractionSkillCount == ComputedDesignSpecExtractionSkillCount - && bEveryLiveSkillReadsAuthoritativeSourceSurfaces - == bComputedEveryLiveSkillReadsAuthoritativeSourceSurfaces - && bEverySkillPreservesOptionalAssistiveOffState - == bComputedEverySkillPreservesOptionalAssistiveOffState - && bEveryLiveSkillHasValidationHarnessCoverage - == bComputedEveryLiveSkillHasValidationHarnessCoverage - && bStructuredExtractionRemainsBounded - == bComputedStructuredExtractionBounded - && bNoBrowserDiagnosticsWidening - == bComputedNoBrowserDiagnosticsWidening - && bNoDesignTranslationWidening - == bComputedNoDesignTranslationWidening; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -3627,79 +3122,7 @@ struct FHyperTwistSkillBrowserDiagnosticSkill UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (SkillId.IsEmpty() - || DisplayLabel.IsEmpty() - || CommandSurfaceId.IsEmpty() - || ServiceBindingId.IsEmpty() - || OwnerLaneId.IsEmpty() - || OwnerFeatureId.IsEmpty() - || Status == EHyperTwistSkillStatus::None - || PermissionScopeIds.Num() == 0 - || SourceSurfaceIds.Num() == 0 - || RequiredExtractionSkillIds.Num() == 0 - || OutputArtifactKinds.Num() == 0 - || PreviewHeadlines.Num() == 0 - || SourceSurfaceCount != SourceSurfaceIds.Num() - || RequiredExtractionSkillCount != RequiredExtractionSkillIds.Num() - || !bReadsAuthoritativeBrowserAndDocSurfaces - || !bPreservesOptionalAssistiveOffState - || !bDerivedAssistiveOnly - || !bHasValidationHarnessCoverage - || !bBoundedToDiagnosticsOnly - || !bRequiresExtractionSubstrate - || !bAvoidsDesignTranslationWidening - || bCapturesBrowserTrace == bPerformsBrowserApiDiscovery) - { - return false; - } - - for (const FString& Value : PermissionScopeIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : SourceSurfaceIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : RequiredExtractionSkillIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : OutputArtifactKinds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : PreviewHeadlines) - { - if (Value.IsEmpty()) - { - return false; - } - } - - return Status == EHyperTwistSkillStatus::ImplementedNow - && bLiveSkill - && bAvailableNow - && !bRequiresOwnerActivation; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -3761,79 +3184,7 @@ struct FHyperTwistSkillBrowserDiagnosticsState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (RegistryId.IsEmpty() - || ManifestVersion.IsEmpty() - || ReferenceUtc.IsEmpty() - || CommandSurfaceRootId.IsEmpty() - || TemplateVersion.IsEmpty() - || Skills.Num() == 0 - || SkillCount != Skills.Num() - || !bEveryLiveSkillReadsAuthoritativeBrowserAndDocSurfaces - || !bEverySkillPreservesOptionalAssistiveOffState - || !bEveryLiveSkillHasValidationHarnessCoverage - || !bDiagnosticsRemainBounded - || !bEverySkillRequiresExtractionSubstrate - || !bNoDesignTranslationWidening) - { - return false; - } - - TArray SeenSkillIds; - int32 ComputedLiveSkillCount = 0; - int32 ComputedAvailableNowCount = 0; - int32 ComputedBrowserTraceCaptureSkillCount = 0; - int32 ComputedBrowserApiDiscoverySkillCount = 0; - bool bComputedEveryLiveSkillReadsAuthoritativeBrowserAndDocSurfaces = true; - bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; - bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; - bool bComputedDiagnosticsRemainBounded = true; - bool bComputedEverySkillRequiresExtractionSubstrate = true; - bool bComputedNoDesignTranslationWidening = true; - - for (const FHyperTwistSkillBrowserDiagnosticSkill& Skill : Skills) - { - if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) - { - return false; - } - - SeenSkillIds.Add(Skill.SkillId); - ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; - ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; - ComputedBrowserTraceCaptureSkillCount += Skill.bCapturesBrowserTrace ? 1 : 0; - ComputedBrowserApiDiscoverySkillCount += Skill.bPerformsBrowserApiDiscovery ? 1 : 0; - bComputedEverySkillPreservesOptionalAssistiveOffState &= - Skill.bPreservesOptionalAssistiveOffState; - bComputedDiagnosticsRemainBounded &= Skill.bBoundedToDiagnosticsOnly; - bComputedEverySkillRequiresExtractionSubstrate &= Skill.bRequiresExtractionSubstrate; - bComputedNoDesignTranslationWidening &= Skill.bAvoidsDesignTranslationWidening; - - if (Skill.bLiveSkill) - { - bComputedEveryLiveSkillReadsAuthoritativeBrowserAndDocSurfaces &= - Skill.bReadsAuthoritativeBrowserAndDocSurfaces; - bComputedEveryLiveSkillHasValidationHarnessCoverage &= - Skill.bHasValidationHarnessCoverage; - } - } - - return LiveSkillCount == ComputedLiveSkillCount - && AvailableNowCount == ComputedAvailableNowCount - && BrowserTraceCaptureSkillCount == ComputedBrowserTraceCaptureSkillCount - && BrowserApiDiscoverySkillCount == ComputedBrowserApiDiscoverySkillCount - && bEveryLiveSkillReadsAuthoritativeBrowserAndDocSurfaces - == bComputedEveryLiveSkillReadsAuthoritativeBrowserAndDocSurfaces - && bEverySkillPreservesOptionalAssistiveOffState - == bComputedEverySkillPreservesOptionalAssistiveOffState - && bEveryLiveSkillHasValidationHarnessCoverage - == bComputedEveryLiveSkillHasValidationHarnessCoverage - && bDiagnosticsRemainBounded == bComputedDiagnosticsRemainBounded - && bEverySkillRequiresExtractionSubstrate - == bComputedEverySkillRequiresExtractionSubstrate - && bNoDesignTranslationWidening == bComputedNoDesignTranslationWidening; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -3931,90 +3282,7 @@ struct FHyperTwistSkillDesignShellSkill UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (SkillId.IsEmpty() - || DisplayLabel.IsEmpty() - || CommandSurfaceId.IsEmpty() - || ServiceBindingId.IsEmpty() - || OwnerLaneId.IsEmpty() - || OwnerFeatureId.IsEmpty() - || Status == EHyperTwistSkillStatus::None - || PermissionScopeIds.Num() == 0 - || SourceSurfaceIds.Num() == 0 - || RequiredExtractionSkillIds.Num() == 0 - || RequiredBrowserDiagnosticSkillIds.Num() == 0 - || OutputArtifactKinds.Num() == 0 - || PreviewHeadlines.Num() == 0 - || SourceSurfaceCount != SourceSurfaceIds.Num() - || RequiredExtractionSkillCount != RequiredExtractionSkillIds.Num() - || RequiredBrowserDiagnosticSkillCount != RequiredBrowserDiagnosticSkillIds.Num() - || !bReadsAuthoritativeDocsBrowserAndDesignSurfaces - || !bPreservesOptionalAssistiveOffState - || !bDerivedAssistiveOnly - || !bHasValidationHarnessCoverage - || !bBoundedToDesignShellOnly - || !bRequiresExtractionSubstrate - || !bRequiresBrowserDiagnosticsSubstrate - || !bAvoidsGenericBrowserShellWidening - || bTranslatesDesignShell == bTranslatesInteractionContract) - { - return false; - } - - for (const FString& Value : PermissionScopeIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : SourceSurfaceIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : RequiredExtractionSkillIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : RequiredBrowserDiagnosticSkillIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : OutputArtifactKinds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : PreviewHeadlines) - { - if (Value.IsEmpty()) - { - return false; - } - } - - return Status == EHyperTwistSkillStatus::ImplementedNow - && bLiveSkill - && bAvailableNow - && !bRequiresOwnerActivation; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -4079,93 +3347,7 @@ struct FHyperTwistSkillDesignShellState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (RegistryId.IsEmpty() - || ManifestVersion.IsEmpty() - || ReferenceUtc.IsEmpty() - || CommandSurfaceRootId.IsEmpty() - || TemplateVersion.IsEmpty() - || Skills.Num() == 0 - || SkillCount != Skills.Num() - || !bEveryLiveSkillReadsAuthoritativeDocsBrowserAndDesignSurfaces - || !bEverySkillPreservesOptionalAssistiveOffState - || !bEveryLiveSkillHasValidationHarnessCoverage - || !bDesignShellTranslationRemainsBounded - || !bEverySkillRequiresExtractionSubstrate - || !bEverySkillRequiresBrowserDiagnosticsSubstrate - || !bNoGenericBrowserShellWidening) - { - return false; - } - - TArray SeenSkillIds; - int32 ComputedLiveSkillCount = 0; - int32 ComputedAvailableNowCount = 0; - int32 ComputedDesignShellTranslationSkillCount = 0; - int32 ComputedInteractionContractTranslationSkillCount = 0; - bool bComputedEveryLiveSkillReadsAuthoritativeDocsBrowserAndDesignSurfaces = true; - bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; - bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; - bool bComputedDesignShellTranslationRemainsBounded = true; - bool bComputedEverySkillRequiresExtractionSubstrate = true; - bool bComputedEverySkillRequiresBrowserDiagnosticsSubstrate = true; - bool bComputedNoGenericBrowserShellWidening = true; - - for (const FHyperTwistSkillDesignShellSkill& Skill : Skills) - { - if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) - { - return false; - } - - SeenSkillIds.Add(Skill.SkillId); - ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; - ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; - ComputedDesignShellTranslationSkillCount += Skill.bTranslatesDesignShell ? 1 : 0; - ComputedInteractionContractTranslationSkillCount += - Skill.bTranslatesInteractionContract ? 1 : 0; - bComputedEverySkillPreservesOptionalAssistiveOffState &= - Skill.bPreservesOptionalAssistiveOffState; - bComputedDesignShellTranslationRemainsBounded &= - Skill.bBoundedToDesignShellOnly; - bComputedEverySkillRequiresExtractionSubstrate &= - Skill.bRequiresExtractionSubstrate; - bComputedEverySkillRequiresBrowserDiagnosticsSubstrate &= - Skill.bRequiresBrowserDiagnosticsSubstrate; - bComputedNoGenericBrowserShellWidening &= - Skill.bAvoidsGenericBrowserShellWidening; - - if (Skill.bLiveSkill) - { - bComputedEveryLiveSkillReadsAuthoritativeDocsBrowserAndDesignSurfaces &= - Skill.bReadsAuthoritativeDocsBrowserAndDesignSurfaces; - bComputedEveryLiveSkillHasValidationHarnessCoverage &= - Skill.bHasValidationHarnessCoverage; - } - } - - return LiveSkillCount == ComputedLiveSkillCount - && AvailableNowCount == ComputedAvailableNowCount - && DesignShellTranslationSkillCount - == ComputedDesignShellTranslationSkillCount - && InteractionContractTranslationSkillCount - == ComputedInteractionContractTranslationSkillCount - && bEveryLiveSkillReadsAuthoritativeDocsBrowserAndDesignSurfaces - == bComputedEveryLiveSkillReadsAuthoritativeDocsBrowserAndDesignSurfaces - && bEverySkillPreservesOptionalAssistiveOffState - == bComputedEverySkillPreservesOptionalAssistiveOffState - && bEveryLiveSkillHasValidationHarnessCoverage - == bComputedEveryLiveSkillHasValidationHarnessCoverage - && bDesignShellTranslationRemainsBounded - == bComputedDesignShellTranslationRemainsBounded - && bEverySkillRequiresExtractionSubstrate - == bComputedEverySkillRequiresExtractionSubstrate - && bEverySkillRequiresBrowserDiagnosticsSubstrate - == bComputedEverySkillRequiresBrowserDiagnosticsSubstrate - && bNoGenericBrowserShellWidening - == bComputedNoGenericBrowserShellWidening; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -4278,104 +3460,7 @@ struct FHyperTwistSkillWorkflowReviewSkill UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (SkillId.IsEmpty() - || DisplayLabel.IsEmpty() - || CommandSurfaceId.IsEmpty() - || ServiceBindingId.IsEmpty() - || OwnerLaneId.IsEmpty() - || OwnerFeatureId.IsEmpty() - || Status == EHyperTwistSkillStatus::None - || PermissionScopeIds.Num() == 0 - || SourceSurfaceIds.Num() == 0 - || RequiredExtractionSkillIds.Num() == 0 - || RequiredWorkflowMemorySkillIds.Num() == 0 - || RequiredDesignShellSkillIds.Num() == 0 - || OutputArtifactKinds.Num() == 0 - || PreviewHeadlines.Num() == 0 - || SourceSurfaceCount != SourceSurfaceIds.Num() - || RequiredExtractionSkillCount != RequiredExtractionSkillIds.Num() - || RequiredWorkflowMemorySkillCount != RequiredWorkflowMemorySkillIds.Num() - || RequiredDesignShellSkillCount != RequiredDesignShellSkillIds.Num() - || !bReadsAuthoritativeWorkflowAndReviewSurfaces - || !bPreservesOptionalAssistiveOffState - || !bDerivedAssistiveOnly - || !bHasValidationHarnessCoverage - || !bBoundedToWorkflowReviewOnly - || !bRequiresExtractionSubstrate - || !bRequiresWorkflowMemorySubstrate - || !bRequiresDesignShellSubstrate - || !bAvoidsImplementationReviewDelegationWidening - || !bAvoidsPlanSynthesisWidening) - { - return false; - } - - for (const FString& Value : PermissionScopeIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : SourceSurfaceIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : RequiredExtractionSkillIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : RequiredWorkflowMemorySkillIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : RequiredDesignShellSkillIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : OutputArtifactKinds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : PreviewHeadlines) - { - if (Value.IsEmpty()) - { - return false; - } - } - - const int32 ReviewModeCount = - (bReviewsProposal ? 1 : 0) + (bReviewsDiff ? 1 : 0) + (bWrapsBoundedWorkflow ? 1 : 0); - return ReviewModeCount == 1 - && Status == EHyperTwistSkillStatus::ImplementedNow - && bLiveSkill - && bAvailableNow - && !bRequiresOwnerActivation; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -4449,103 +3534,7 @@ struct FHyperTwistSkillWorkflowReviewState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (RegistryId.IsEmpty() - || ManifestVersion.IsEmpty() - || ReferenceUtc.IsEmpty() - || CommandSurfaceRootId.IsEmpty() - || TemplateVersion.IsEmpty() - || Skills.Num() == 0 - || SkillCount != Skills.Num() - || !bEveryLiveSkillReadsAuthoritativeWorkflowAndReviewSurfaces - || !bEverySkillPreservesOptionalAssistiveOffState - || !bEveryLiveSkillHasValidationHarnessCoverage - || !bWorkflowReviewRemainsBounded - || !bEverySkillRequiresExtractionSubstrate - || !bEverySkillRequiresWorkflowMemorySubstrate - || !bEverySkillRequiresDesignShellSubstrate - || !bNoImplementationReviewDelegationWidening - || !bNoPlanSynthesisWidening) - { - return false; - } - - TArray SeenSkillIds; - int32 ComputedLiveSkillCount = 0; - int32 ComputedAvailableNowCount = 0; - int32 ComputedProposalReviewSkillCount = 0; - int32 ComputedDiffReviewSkillCount = 0; - int32 ComputedBoundedWorkflowWrapperSkillCount = 0; - bool bComputedEveryLiveSkillReadsAuthoritativeWorkflowAndReviewSurfaces = true; - bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; - bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; - bool bComputedWorkflowReviewRemainsBounded = true; - bool bComputedEverySkillRequiresExtractionSubstrate = true; - bool bComputedEverySkillRequiresWorkflowMemorySubstrate = true; - bool bComputedEverySkillRequiresDesignShellSubstrate = true; - bool bComputedNoImplementationReviewDelegationWidening = true; - bool bComputedNoPlanSynthesisWidening = true; - - for (const FHyperTwistSkillWorkflowReviewSkill& Skill : Skills) - { - if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) - { - return false; - } - - SeenSkillIds.Add(Skill.SkillId); - ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; - ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; - ComputedProposalReviewSkillCount += Skill.bReviewsProposal ? 1 : 0; - ComputedDiffReviewSkillCount += Skill.bReviewsDiff ? 1 : 0; - ComputedBoundedWorkflowWrapperSkillCount += Skill.bWrapsBoundedWorkflow ? 1 : 0; - bComputedEverySkillPreservesOptionalAssistiveOffState &= - Skill.bPreservesOptionalAssistiveOffState; - bComputedWorkflowReviewRemainsBounded &= Skill.bBoundedToWorkflowReviewOnly; - bComputedEverySkillRequiresExtractionSubstrate &= Skill.bRequiresExtractionSubstrate; - bComputedEverySkillRequiresWorkflowMemorySubstrate &= - Skill.bRequiresWorkflowMemorySubstrate; - bComputedEverySkillRequiresDesignShellSubstrate &= - Skill.bRequiresDesignShellSubstrate; - bComputedNoImplementationReviewDelegationWidening &= - Skill.bAvoidsImplementationReviewDelegationWidening; - bComputedNoPlanSynthesisWidening &= Skill.bAvoidsPlanSynthesisWidening; - - if (Skill.bLiveSkill) - { - bComputedEveryLiveSkillReadsAuthoritativeWorkflowAndReviewSurfaces &= - Skill.bReadsAuthoritativeWorkflowAndReviewSurfaces; - bComputedEveryLiveSkillHasValidationHarnessCoverage &= - Skill.bHasValidationHarnessCoverage; - } - } - - return LiveSkillCount == ComputedLiveSkillCount - && AvailableNowCount == ComputedAvailableNowCount - && ProposalReviewSkillCount == ComputedProposalReviewSkillCount - && DiffReviewSkillCount == ComputedDiffReviewSkillCount - && BoundedWorkflowWrapperSkillCount - == ComputedBoundedWorkflowWrapperSkillCount - && bEveryLiveSkillReadsAuthoritativeWorkflowAndReviewSurfaces - == bComputedEveryLiveSkillReadsAuthoritativeWorkflowAndReviewSurfaces - && bEverySkillPreservesOptionalAssistiveOffState - == bComputedEverySkillPreservesOptionalAssistiveOffState - && bEveryLiveSkillHasValidationHarnessCoverage - == bComputedEveryLiveSkillHasValidationHarnessCoverage - && bWorkflowReviewRemainsBounded - == bComputedWorkflowReviewRemainsBounded - && bEverySkillRequiresExtractionSubstrate - == bComputedEverySkillRequiresExtractionSubstrate - && bEverySkillRequiresWorkflowMemorySubstrate - == bComputedEverySkillRequiresWorkflowMemorySubstrate - && bEverySkillRequiresDesignShellSubstrate - == bComputedEverySkillRequiresDesignShellSubstrate - && bNoImplementationReviewDelegationWidening - == bComputedNoImplementationReviewDelegationWidening - && bNoPlanSynthesisWidening - == bComputedNoPlanSynthesisWidening; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -4631,88 +3620,7 @@ struct FHyperTwistSkillImplementationDelegationSpec UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (SpecId.IsEmpty() - || SkillId.IsEmpty() - || DisplayLabel.IsEmpty() - || CommandSurfaceId.IsEmpty() - || ServiceBindingId.IsEmpty() - || OwnerLaneId.IsEmpty() - || OwnerFeatureId.IsEmpty() - || InputArtifactKinds.Num() == 0 - || OutputArtifactKinds.Num() == 0 - || RequiredWorkflowReviewSkillIds.Num() == 0 - || RequiredWorkflowReviewSkillCount != RequiredWorkflowReviewSkillIds.Num() - || RequiredDesignShellSkillIds.Num() == 0 - || RequiredDesignShellSkillCount != RequiredDesignShellSkillIds.Num() - || SpecStepIds.Num() == 0 - || SafetyRuleIds.Num() == 0 - || !bUsesFirstPartyTermsOnly - || !bPreservesOptionalAssistiveOffState - || !bDerivedAssistiveOnly - || !bRequiresProvenanceLedger - || !bBoundedToImplementationReviewAndDelegationOnly - || !bAvoidsPlanSynthesisWidening - || !bAvoidsAutonomousExecutionClaims - || !bReadyForFutureWrapperBinding) - { - return false; - } - - for (const FString& Value : InputArtifactKinds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : OutputArtifactKinds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : RequiredWorkflowReviewSkillIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : RequiredDesignShellSkillIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : SpecStepIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : SafetyRuleIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - const int32 SpecModeCount = - (bCoversImplementationReview ? 1 : 0) - + (bDefinesBoundedDelegationSpec ? 1 : 0); - return SpecModeCount == 1; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -4786,106 +3694,7 @@ struct FHyperTwistSkillImplementationDelegationState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (RegistryId.IsEmpty() - || ManifestVersion.IsEmpty() - || ReferenceUtc.IsEmpty() - || CommandSurfaceRootId.IsEmpty() - || TemplateVersion.IsEmpty() - || Specs.Num() == 0 - || SkillCount <= 0 - || SpecCount != Specs.Num() - || StepCount <= 0 - || SafetyRuleCount <= 0 - || !bEverySpecUsesFirstPartyTerms - || !bEverySpecPreservesOptionalAssistiveOffState - || !bEverySpecRequiresProvenanceLedger - || !bEverySpecRemainsBounded - || !bEverySpecRequiresWorkflowReviewSubstrate - || !bEverySpecRequiresDesignShellSubstrate - || !bNoPlanSynthesisWidening - || !bNoAutonomousExecutionClaims - || !bEverySpecReadyForFutureWrapperBinding) - { - return false; - } - - TArray SeenSpecIds; - TArray SeenSkillIds; - TArray SeenStepIds; - TArray SeenSafetyRuleIds; - int32 ComputedImplementationReviewSpecCount = 0; - int32 ComputedDelegationSpecCount = 0; - bool bComputedFirstPartyTerms = true; - bool bComputedPreservesOffState = true; - bool bComputedRequiresProvenanceLedger = true; - bool bComputedRemainsBounded = true; - bool bComputedRequiresWorkflowReview = true; - bool bComputedRequiresDesignShell = true; - bool bComputedNoPlanSynthesisWidening = true; - bool bComputedNoAutonomousExecutionClaims = true; - bool bComputedReadyForFutureWrapperBinding = true; - - for (const FHyperTwistSkillImplementationDelegationSpec& Spec : Specs) - { - if (!Spec.IsStructurallyValid() || SeenSpecIds.Contains(Spec.SpecId)) - { - return false; - } - - SeenSpecIds.Add(Spec.SpecId); - SeenSkillIds.AddUnique(Spec.SkillId); - ComputedImplementationReviewSpecCount += - Spec.bCoversImplementationReview ? 1 : 0; - ComputedDelegationSpecCount += - Spec.bDefinesBoundedDelegationSpec ? 1 : 0; - bComputedFirstPartyTerms &= Spec.bUsesFirstPartyTermsOnly; - bComputedPreservesOffState &= Spec.bPreservesOptionalAssistiveOffState; - bComputedRequiresProvenanceLedger &= Spec.bRequiresProvenanceLedger; - bComputedRemainsBounded &= - Spec.bBoundedToImplementationReviewAndDelegationOnly; - bComputedRequiresWorkflowReview &= - Spec.RequiredWorkflowReviewSkillIds.Num() > 0; - bComputedRequiresDesignShell &= - Spec.RequiredDesignShellSkillIds.Num() > 0; - bComputedNoPlanSynthesisWidening &= - Spec.bAvoidsPlanSynthesisWidening; - bComputedNoAutonomousExecutionClaims &= - Spec.bAvoidsAutonomousExecutionClaims; - bComputedReadyForFutureWrapperBinding &= - Spec.bReadyForFutureWrapperBinding; - - for (const FString& StepId : Spec.SpecStepIds) - { - SeenStepIds.AddUnique(StepId); - } - - for (const FString& SafetyRuleId : Spec.SafetyRuleIds) - { - SeenSafetyRuleIds.AddUnique(SafetyRuleId); - } - } - - return SkillCount == SeenSkillIds.Num() - && StepCount == SeenStepIds.Num() - && SafetyRuleCount == SeenSafetyRuleIds.Num() - && ImplementationReviewSpecCount == ComputedImplementationReviewSpecCount - && DelegationSpecCount == ComputedDelegationSpecCount - && bEverySpecUsesFirstPartyTerms == bComputedFirstPartyTerms - && bEverySpecPreservesOptionalAssistiveOffState == bComputedPreservesOffState - && bEverySpecRequiresProvenanceLedger == bComputedRequiresProvenanceLedger - && bEverySpecRemainsBounded == bComputedRemainsBounded - && bEverySpecRequiresWorkflowReviewSubstrate - == bComputedRequiresWorkflowReview - && bEverySpecRequiresDesignShellSubstrate - == bComputedRequiresDesignShell - && bNoPlanSynthesisWidening == bComputedNoPlanSynthesisWidening - && bNoAutonomousExecutionClaims - == bComputedNoAutonomousExecutionClaims - && bEverySpecReadyForFutureWrapperBinding - == bComputedReadyForFutureWrapperBinding; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -4998,106 +3807,7 @@ struct FHyperTwistSkillPlanOrchestrationSkill UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (SkillId.IsEmpty() - || DisplayLabel.IsEmpty() - || CommandSurfaceId.IsEmpty() - || ServiceBindingId.IsEmpty() - || OwnerLaneId.IsEmpty() - || OwnerFeatureId.IsEmpty() - || Status == EHyperTwistSkillStatus::None - || PermissionScopeIds.Num() == 0 - || SourceSurfaceIds.Num() == 0 - || RequiredImplementationDelegationSkillIds.Num() == 0 - || RequiredWorkflowMemorySkillIds.Num() == 0 - || RequiredWorkflowReviewSkillIds.Num() == 0 - || OutputArtifactKinds.Num() == 0 - || PreviewHeadlines.Num() == 0 - || SourceSurfaceCount != SourceSurfaceIds.Num() - || RequiredImplementationDelegationSkillCount - != RequiredImplementationDelegationSkillIds.Num() - || RequiredWorkflowMemorySkillCount != RequiredWorkflowMemorySkillIds.Num() - || RequiredWorkflowReviewSkillCount != RequiredWorkflowReviewSkillIds.Num() - || !bReadsAuthoritativeWorkflowImplementationAndMemorySurfaces - || !bPreservesOptionalAssistiveOffState - || !bDerivedAssistiveOnly - || !bHasValidationHarnessCoverage - || !bBoundedToPlanOrchestrationOnly - || !bRequiresImplementationDelegationSubstrate - || !bRequiresWorkflowMemorySubstrate - || !bRequiresWorkflowReviewSubstrate - || !bAvoidsProviderWidening - || !bAvoidsDomainSkillPackWidening - || !bAvoidsAutonomousExecutionClaims) - { - return false; - } - - for (const FString& Value : PermissionScopeIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : SourceSurfaceIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : RequiredImplementationDelegationSkillIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : RequiredWorkflowMemorySkillIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : RequiredWorkflowReviewSkillIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : OutputArtifactKinds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : PreviewHeadlines) - { - if (Value.IsEmpty()) - { - return false; - } - } - - const int32 OrchestrationModeCount = - (bSynthesizesBoundedPlan ? 1 : 0) + (bChainsBoundedWorkflow ? 1 : 0); - return OrchestrationModeCount == 1 - && Status == EHyperTwistSkillStatus::ImplementedNow - && bLiveSkill - && bAvailableNow - && !bRequiresOwnerActivation; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -5171,105 +3881,7 @@ struct FHyperTwistSkillPlanOrchestrationState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (RegistryId.IsEmpty() - || ManifestVersion.IsEmpty() - || ReferenceUtc.IsEmpty() - || CommandSurfaceRootId.IsEmpty() - || TemplateVersion.IsEmpty() - || Skills.Num() == 0 - || SkillCount != Skills.Num() - || !bEveryLiveSkillReadsAuthoritativeWorkflowImplementationAndMemorySurfaces - || !bEverySkillPreservesOptionalAssistiveOffState - || !bEveryLiveSkillHasValidationHarnessCoverage - || !bPlanOrchestrationRemainsBounded - || !bEverySkillRequiresImplementationDelegationSubstrate - || !bEverySkillRequiresWorkflowMemorySubstrate - || !bEverySkillRequiresWorkflowReviewSubstrate - || !bNoProviderWidening - || !bNoDomainSkillPackWidening - || !bNoAutonomousExecutionClaims) - { - return false; - } - - TArray SeenSkillIds; - int32 ComputedLiveSkillCount = 0; - int32 ComputedAvailableNowCount = 0; - int32 ComputedPlanSynthesisSkillCount = 0; - int32 ComputedWorkflowChainingSkillCount = 0; - bool bComputedEveryLiveSkillReadsAuthoritativeWorkflowImplementationAndMemorySurfaces = - true; - bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; - bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; - bool bComputedPlanOrchestrationRemainsBounded = true; - bool bComputedEverySkillRequiresImplementationDelegationSubstrate = true; - bool bComputedEverySkillRequiresWorkflowMemorySubstrate = true; - bool bComputedEverySkillRequiresWorkflowReviewSubstrate = true; - bool bComputedNoProviderWidening = true; - bool bComputedNoDomainSkillPackWidening = true; - bool bComputedNoAutonomousExecutionClaims = true; - - for (const FHyperTwistSkillPlanOrchestrationSkill& Skill : Skills) - { - if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) - { - return false; - } - - SeenSkillIds.Add(Skill.SkillId); - ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; - ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; - ComputedPlanSynthesisSkillCount += Skill.bSynthesizesBoundedPlan ? 1 : 0; - ComputedWorkflowChainingSkillCount += Skill.bChainsBoundedWorkflow ? 1 : 0; - bComputedEverySkillPreservesOptionalAssistiveOffState &= - Skill.bPreservesOptionalAssistiveOffState; - bComputedPlanOrchestrationRemainsBounded &= - Skill.bBoundedToPlanOrchestrationOnly; - bComputedEverySkillRequiresImplementationDelegationSubstrate &= - Skill.bRequiresImplementationDelegationSubstrate; - bComputedEverySkillRequiresWorkflowMemorySubstrate &= - Skill.bRequiresWorkflowMemorySubstrate; - bComputedEverySkillRequiresWorkflowReviewSubstrate &= - Skill.bRequiresWorkflowReviewSubstrate; - bComputedNoProviderWidening &= Skill.bAvoidsProviderWidening; - bComputedNoDomainSkillPackWidening &= Skill.bAvoidsDomainSkillPackWidening; - bComputedNoAutonomousExecutionClaims &= - Skill.bAvoidsAutonomousExecutionClaims; - - if (Skill.bLiveSkill) - { - bComputedEveryLiveSkillReadsAuthoritativeWorkflowImplementationAndMemorySurfaces &= - Skill.bReadsAuthoritativeWorkflowImplementationAndMemorySurfaces; - bComputedEveryLiveSkillHasValidationHarnessCoverage &= - Skill.bHasValidationHarnessCoverage; - } - } - - return LiveSkillCount == ComputedLiveSkillCount - && AvailableNowCount == ComputedAvailableNowCount - && PlanSynthesisSkillCount == ComputedPlanSynthesisSkillCount - && WorkflowChainingSkillCount == ComputedWorkflowChainingSkillCount - && bEveryLiveSkillReadsAuthoritativeWorkflowImplementationAndMemorySurfaces - == bComputedEveryLiveSkillReadsAuthoritativeWorkflowImplementationAndMemorySurfaces - && bEverySkillPreservesOptionalAssistiveOffState - == bComputedEverySkillPreservesOptionalAssistiveOffState - && bEveryLiveSkillHasValidationHarnessCoverage - == bComputedEveryLiveSkillHasValidationHarnessCoverage - && bPlanOrchestrationRemainsBounded - == bComputedPlanOrchestrationRemainsBounded - && bEverySkillRequiresImplementationDelegationSubstrate - == bComputedEverySkillRequiresImplementationDelegationSubstrate - && bEverySkillRequiresWorkflowMemorySubstrate - == bComputedEverySkillRequiresWorkflowMemorySubstrate - && bEverySkillRequiresWorkflowReviewSubstrate - == bComputedEverySkillRequiresWorkflowReviewSubstrate - && bNoProviderWidening == bComputedNoProviderWidening - && bNoDomainSkillPackWidening == bComputedNoDomainSkillPackWidening - && bNoAutonomousExecutionClaims - == bComputedNoAutonomousExecutionClaims; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -5376,89 +3988,7 @@ struct FHyperTwistSkillProviderProfileRoutingSkill UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (SkillId.IsEmpty() - || DisplayLabel.IsEmpty() - || CommandSurfaceId.IsEmpty() - || ServiceBindingId.IsEmpty() - || OwnerLaneId.IsEmpty() - || OwnerFeatureId.IsEmpty() - || Status == EHyperTwistSkillStatus::None - || PermissionScopeIds.Num() == 0 - || SourceSurfaceIds.Num() == 0 - || RequiredAnalyzerWrapperSkillIds.Num() == 0 - || OutputArtifactKinds.Num() == 0 - || PreviewHeadlines.Num() == 0 - || SourceSurfaceCount != SourceSurfaceIds.Num() - || RequiredAnalyzerWrapperSkillCount - != RequiredAnalyzerWrapperSkillIds.Num() - || !bReadsAuthoritativeProviderNeutralState - || !bPreservesOptionalAssistiveOffState - || !bDerivedAssistiveOnly - || !bHasValidationHarnessCoverage - || !bBoundedToProviderProfileRoutingOnly - || !bRequiresAnalyzerWrapperSubstrate - || !bRequiresProviderSessionConfigState - || !bRequiresProviderServiceHealthState - || !bPreservesOpenAiCompatibleCustomEndpointFirstClass - || !bPreservesUserLabeledByokProfiles - || !bPreservesProviderNeutrality - || !bAvoidsProviderSpecificOverlayWidening) - { - return false; - } - - for (const FString& Value : PermissionScopeIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : SourceSurfaceIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : RequiredAnalyzerWrapperSkillIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : OutputArtifactKinds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : PreviewHeadlines) - { - if (Value.IsEmpty()) - { - return false; - } - } - - const int32 ProviderModeCount = - (bInspectsProviderProfile ? 1 : 0) - + (bSetsUpByokProfile ? 1 : 0) - + (bDiagnosesRouting ? 1 : 0); - return ProviderModeCount == 1 - && Status == EHyperTwistSkillStatus::ImplementedNow - && bLiveSkill - && bAvailableNow - && !bRequiresOwnerActivation; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -5538,119 +4068,7 @@ struct FHyperTwistSkillProviderProfileRoutingState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (RegistryId.IsEmpty() - || ManifestVersion.IsEmpty() - || ReferenceUtc.IsEmpty() - || CommandSurfaceRootId.IsEmpty() - || TemplateVersion.IsEmpty() - || Skills.Num() == 0 - || SkillCount != Skills.Num() - || !bEveryLiveSkillReadsAuthoritativeProviderNeutralState - || !bEverySkillPreservesOptionalAssistiveOffState - || !bEveryLiveSkillHasValidationHarnessCoverage - || !bProviderProfileRoutingRemainsBounded - || !bEverySkillRequiresAnalyzerWrapperSubstrate - || !bEverySkillRequiresProviderSessionConfigState - || !bEverySkillRequiresProviderServiceHealthState - || !bOpenAiCompatibleCustomEndpointsRemainFirstClass - || !bUserLabeledByokProfilesRemainSupported - || !bProviderNeutralityRemainsPreserved - || !bNoProviderSpecificOverlayWidening) - { - return false; - } - - TArray SeenSkillIds; - int32 ComputedLiveSkillCount = 0; - int32 ComputedAvailableNowCount = 0; - int32 ComputedProviderProfileInspectionSkillCount = 0; - int32 ComputedByokProfileSetupSkillCount = 0; - int32 ComputedRoutingDiagnosticSkillCount = 0; - bool bComputedEveryLiveSkillReadsAuthoritativeProviderNeutralState = true; - bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; - bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; - bool bComputedProviderProfileRoutingRemainsBounded = true; - bool bComputedEverySkillRequiresAnalyzerWrapperSubstrate = true; - bool bComputedEverySkillRequiresProviderSessionConfigState = true; - bool bComputedEverySkillRequiresProviderServiceHealthState = true; - bool bComputedOpenAiCompatibleCustomEndpointsRemainFirstClass = true; - bool bComputedUserLabeledByokProfilesRemainSupported = true; - bool bComputedProviderNeutralityRemainsPreserved = true; - bool bComputedNoProviderSpecificOverlayWidening = true; - - for (const FHyperTwistSkillProviderProfileRoutingSkill& Skill : Skills) - { - if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) - { - return false; - } - - SeenSkillIds.Add(Skill.SkillId); - ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; - ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; - ComputedProviderProfileInspectionSkillCount += - Skill.bInspectsProviderProfile ? 1 : 0; - ComputedByokProfileSetupSkillCount += Skill.bSetsUpByokProfile ? 1 : 0; - ComputedRoutingDiagnosticSkillCount += Skill.bDiagnosesRouting ? 1 : 0; - bComputedEverySkillPreservesOptionalAssistiveOffState &= - Skill.bPreservesOptionalAssistiveOffState; - bComputedProviderProfileRoutingRemainsBounded &= - Skill.bBoundedToProviderProfileRoutingOnly; - bComputedEverySkillRequiresAnalyzerWrapperSubstrate &= - Skill.bRequiresAnalyzerWrapperSubstrate; - bComputedEverySkillRequiresProviderSessionConfigState &= - Skill.bRequiresProviderSessionConfigState; - bComputedEverySkillRequiresProviderServiceHealthState &= - Skill.bRequiresProviderServiceHealthState; - bComputedOpenAiCompatibleCustomEndpointsRemainFirstClass &= - Skill.bPreservesOpenAiCompatibleCustomEndpointFirstClass; - bComputedUserLabeledByokProfilesRemainSupported &= - Skill.bPreservesUserLabeledByokProfiles; - bComputedProviderNeutralityRemainsPreserved &= - Skill.bPreservesProviderNeutrality; - bComputedNoProviderSpecificOverlayWidening &= - Skill.bAvoidsProviderSpecificOverlayWidening; - - if (Skill.bLiveSkill) - { - bComputedEveryLiveSkillReadsAuthoritativeProviderNeutralState &= - Skill.bReadsAuthoritativeProviderNeutralState; - bComputedEveryLiveSkillHasValidationHarnessCoverage &= - Skill.bHasValidationHarnessCoverage; - } - } - - return LiveSkillCount == ComputedLiveSkillCount - && AvailableNowCount == ComputedAvailableNowCount - && ProviderProfileInspectionSkillCount - == ComputedProviderProfileInspectionSkillCount - && ByokProfileSetupSkillCount == ComputedByokProfileSetupSkillCount - && RoutingDiagnosticSkillCount == ComputedRoutingDiagnosticSkillCount - && bEveryLiveSkillReadsAuthoritativeProviderNeutralState - == bComputedEveryLiveSkillReadsAuthoritativeProviderNeutralState - && bEverySkillPreservesOptionalAssistiveOffState - == bComputedEverySkillPreservesOptionalAssistiveOffState - && bEveryLiveSkillHasValidationHarnessCoverage - == bComputedEveryLiveSkillHasValidationHarnessCoverage - && bProviderProfileRoutingRemainsBounded - == bComputedProviderProfileRoutingRemainsBounded - && bEverySkillRequiresAnalyzerWrapperSubstrate - == bComputedEverySkillRequiresAnalyzerWrapperSubstrate - && bEverySkillRequiresProviderSessionConfigState - == bComputedEverySkillRequiresProviderSessionConfigState - && bEverySkillRequiresProviderServiceHealthState - == bComputedEverySkillRequiresProviderServiceHealthState - && bOpenAiCompatibleCustomEndpointsRemainFirstClass - == bComputedOpenAiCompatibleCustomEndpointsRemainFirstClass - && bUserLabeledByokProfilesRemainSupported - == bComputedUserLabeledByokProfilesRemainSupported - && bProviderNeutralityRemainsPreserved - == bComputedProviderNeutralityRemainsPreserved - && bNoProviderSpecificOverlayWidening - == bComputedNoProviderSpecificOverlayWidening; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -5754,88 +4172,7 @@ struct FHyperTwistSkillProviderUsageOperationsAuditSkill UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (SkillId.IsEmpty() - || DisplayLabel.IsEmpty() - || CommandSurfaceId.IsEmpty() - || ServiceBindingId.IsEmpty() - || OwnerLaneId.IsEmpty() - || OwnerFeatureId.IsEmpty() - || Status == EHyperTwistSkillStatus::None - || PermissionScopeIds.Num() == 0 - || SourceSurfaceIds.Num() == 0 - || RequiredProviderProfileRoutingSkillIds.Num() == 0 - || OutputArtifactKinds.Num() == 0 - || PreviewHeadlines.Num() == 0 - || SourceSurfaceCount != SourceSurfaceIds.Num() - || RequiredProviderProfileRoutingSkillCount - != RequiredProviderProfileRoutingSkillIds.Num() - || !bReadsNormalizedFirstPartyState - || !bPreservesOptionalAssistiveOffState - || !bDerivedAssistiveOnly - || !bHasValidationHarnessCoverage - || !bBoundedToUsageOperationsAuditOnly - || !bRequiresProviderProfileRoutingSubstrate - || !bRequiresUsageCostAccountingState - || !bRequiresRouteAndServiceHealthState - || !bPreservesNormalizedFirstPartyAccountingOwnership - || !bAvoidsSettlementExecutionWidening - || !bAvoidsProviderPortalWidening) - { - return false; - } - - for (const FString& Value : PermissionScopeIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : SourceSurfaceIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : RequiredProviderProfileRoutingSkillIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : OutputArtifactKinds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : PreviewHeadlines) - { - if (Value.IsEmpty()) - { - return false; - } - } - - const int32 AuditModeCount = - (bAuditsUsage ? 1 : 0) - + (bInspectsTopology ? 1 : 0) - + (bDiagnosesRouteService ? 1 : 0); - return AuditModeCount == 1 - && Status == EHyperTwistSkillStatus::ImplementedNow - && bLiveSkill - && bAvailableNow - && !bRequiresOwnerActivation; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -5912,113 +4249,7 @@ struct FHyperTwistSkillProviderUsageOperationsAuditState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (RegistryId.IsEmpty() - || ManifestVersion.IsEmpty() - || ReferenceUtc.IsEmpty() - || CommandSurfaceRootId.IsEmpty() - || TemplateVersion.IsEmpty() - || Skills.Num() == 0 - || SkillCount != Skills.Num() - || !bEveryLiveSkillReadsNormalizedFirstPartyState - || !bEverySkillPreservesOptionalAssistiveOffState - || !bEveryLiveSkillHasValidationHarnessCoverage - || !bUsageOperationsAuditRemainsBounded - || !bEverySkillRequiresProviderProfileRoutingSubstrate - || !bEverySkillRequiresUsageCostAccountingState - || !bEverySkillRequiresRouteAndServiceHealthState - || !bNormalizedFirstPartyAccountingOwnershipPreserved - || !bNoSettlementExecutionWidening - || !bNoProviderPortalWidening) - { - return false; - } - - TArray SeenSkillIds; - int32 ComputedLiveSkillCount = 0; - int32 ComputedAvailableNowCount = 0; - int32 ComputedUsageAuditSkillCount = 0; - int32 ComputedTopologyInspectionSkillCount = 0; - int32 ComputedRouteServiceDiagnosticSkillCount = 0; - bool bComputedEveryLiveSkillReadsNormalizedFirstPartyState = true; - bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; - bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; - bool bComputedUsageOperationsAuditRemainsBounded = true; - bool bComputedEverySkillRequiresProviderProfileRoutingSubstrate = true; - bool bComputedEverySkillRequiresUsageCostAccountingState = true; - bool bComputedEverySkillRequiresRouteAndServiceHealthState = true; - bool bComputedNormalizedFirstPartyAccountingOwnershipPreserved = true; - bool bComputedNoSettlementExecutionWidening = true; - bool bComputedNoProviderPortalWidening = true; - - for (const FHyperTwistSkillProviderUsageOperationsAuditSkill& Skill : Skills) - { - if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) - { - return false; - } - - SeenSkillIds.Add(Skill.SkillId); - ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; - ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; - ComputedUsageAuditSkillCount += Skill.bAuditsUsage ? 1 : 0; - ComputedTopologyInspectionSkillCount += Skill.bInspectsTopology ? 1 : 0; - ComputedRouteServiceDiagnosticSkillCount += - Skill.bDiagnosesRouteService ? 1 : 0; - bComputedEverySkillPreservesOptionalAssistiveOffState &= - Skill.bPreservesOptionalAssistiveOffState; - bComputedUsageOperationsAuditRemainsBounded &= - Skill.bBoundedToUsageOperationsAuditOnly; - bComputedEverySkillRequiresProviderProfileRoutingSubstrate &= - Skill.bRequiresProviderProfileRoutingSubstrate; - bComputedEverySkillRequiresUsageCostAccountingState &= - Skill.bRequiresUsageCostAccountingState; - bComputedEverySkillRequiresRouteAndServiceHealthState &= - Skill.bRequiresRouteAndServiceHealthState; - bComputedNormalizedFirstPartyAccountingOwnershipPreserved &= - Skill.bPreservesNormalizedFirstPartyAccountingOwnership; - bComputedNoSettlementExecutionWidening &= - Skill.bAvoidsSettlementExecutionWidening; - bComputedNoProviderPortalWidening &= - Skill.bAvoidsProviderPortalWidening; - - if (Skill.bLiveSkill) - { - bComputedEveryLiveSkillReadsNormalizedFirstPartyState &= - Skill.bReadsNormalizedFirstPartyState; - bComputedEveryLiveSkillHasValidationHarnessCoverage &= - Skill.bHasValidationHarnessCoverage; - } - } - - return LiveSkillCount == ComputedLiveSkillCount - && AvailableNowCount == ComputedAvailableNowCount - && UsageAuditSkillCount == ComputedUsageAuditSkillCount - && TopologyInspectionSkillCount == ComputedTopologyInspectionSkillCount - && RouteServiceDiagnosticSkillCount - == ComputedRouteServiceDiagnosticSkillCount - && bEveryLiveSkillReadsNormalizedFirstPartyState - == bComputedEveryLiveSkillReadsNormalizedFirstPartyState - && bEverySkillPreservesOptionalAssistiveOffState - == bComputedEverySkillPreservesOptionalAssistiveOffState - && bEveryLiveSkillHasValidationHarnessCoverage - == bComputedEveryLiveSkillHasValidationHarnessCoverage - && bUsageOperationsAuditRemainsBounded - == bComputedUsageOperationsAuditRemainsBounded - && bEverySkillRequiresProviderProfileRoutingSubstrate - == bComputedEverySkillRequiresProviderProfileRoutingSubstrate - && bEverySkillRequiresUsageCostAccountingState - == bComputedEverySkillRequiresUsageCostAccountingState - && bEverySkillRequiresRouteAndServiceHealthState - == bComputedEverySkillRequiresRouteAndServiceHealthState - && bNormalizedFirstPartyAccountingOwnershipPreserved - == bComputedNormalizedFirstPartyAccountingOwnershipPreserved - && bNoSettlementExecutionWidening - == bComputedNoSettlementExecutionWidening - && bNoProviderPortalWidening - == bComputedNoProviderPortalWidening; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -6122,97 +4353,7 @@ struct FHyperTwistSkillDomainPackFrameworkSkill UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (SkillId.IsEmpty() - || DisplayLabel.IsEmpty() - || CommandSurfaceId.IsEmpty() - || ServiceBindingId.IsEmpty() - || OwnerLaneId.IsEmpty() - || OwnerFeatureId.IsEmpty() - || Status == EHyperTwistSkillStatus::None - || PermissionScopeIds.Num() == 0 - || SourceSurfaceIds.Num() == 0 - || RequiredPlanOrchestrationSkillIds.Num() == 0 - || RequiredProviderUsageAuditSkillIds.Num() == 0 - || OutputArtifactKinds.Num() == 0 - || PreviewHeadlines.Num() == 0 - || SourceSurfaceCount != SourceSurfaceIds.Num() - || RequiredPlanOrchestrationSkillCount - != RequiredPlanOrchestrationSkillIds.Num() - || RequiredProviderUsageAuditSkillCount - != RequiredProviderUsageAuditSkillIds.Num() - || !bReadsAuthoritativeSkillAndFrameworkState - || !bPreservesOptionalAssistiveOffState - || !bDerivedAssistiveOnly - || !bHasValidationHarnessCoverage - || !bBoundedToDomainPackFrameworkOnly - || !bRequiresPlanOrchestrationSubstrate - || !bRequiresProviderUsageOperationsAuditSubstrate - || !bPreservesPlaceholderDomainPackDeferral - || !bAvoidsRetainedDomainPackClaims - || !bAvoidsCreativeMediaWidening) - { - return false; - } - - for (const FString& Value : PermissionScopeIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : SourceSurfaceIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : RequiredPlanOrchestrationSkillIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : RequiredProviderUsageAuditSkillIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : OutputArtifactKinds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : PreviewHeadlines) - { - if (Value.IsEmpty()) - { - return false; - } - } - - const int32 FrameworkModeCount = - (bSpecifiesPackagingRules ? 1 : 0) - + (bSpecifiesEnableDisableGrouping ? 1 : 0); - return FrameworkModeCount == 1 - && Status == EHyperTwistSkillStatus::ImplementedNow - && bLiveSkill - && bAvailableNow - && !bRequiresOwnerActivation; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -6283,102 +4424,7 @@ struct FHyperTwistSkillDomainPackFrameworkState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (RegistryId.IsEmpty() - || ManifestVersion.IsEmpty() - || ReferenceUtc.IsEmpty() - || CommandSurfaceRootId.IsEmpty() - || TemplateVersion.IsEmpty() - || Skills.Num() == 0 - || SkillCount != Skills.Num() - || !bEveryLiveSkillReadsAuthoritativeSkillAndFrameworkState - || !bEverySkillPreservesOptionalAssistiveOffState - || !bEveryLiveSkillHasValidationHarnessCoverage - || !bDomainPackFrameworkRemainsBounded - || !bEverySkillRequiresPlanOrchestrationSubstrate - || !bEverySkillRequiresProviderUsageOperationsAuditSubstrate - || !bPlaceholderDomainPackDeferralRemainsPreserved - || !bNoRetainedDomainPackClaims - || !bNoCreativeMediaWidening) - { - return false; - } - - TArray SeenSkillIds; - int32 ComputedLiveSkillCount = 0; - int32 ComputedAvailableNowCount = 0; - int32 ComputedPackagingRuleSkillCount = 0; - int32 ComputedEnableDisableGroupingSkillCount = 0; - bool bComputedEveryLiveSkillReadsAuthoritativeSkillAndFrameworkState = true; - bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; - bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; - bool bComputedDomainPackFrameworkRemainsBounded = true; - bool bComputedEverySkillRequiresPlanOrchestrationSubstrate = true; - bool bComputedEverySkillRequiresProviderUsageOperationsAuditSubstrate = true; - bool bComputedPlaceholderDomainPackDeferralRemainsPreserved = true; - bool bComputedNoRetainedDomainPackClaims = true; - bool bComputedNoCreativeMediaWidening = true; - - for (const FHyperTwistSkillDomainPackFrameworkSkill& Skill : Skills) - { - if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) - { - return false; - } - - SeenSkillIds.Add(Skill.SkillId); - ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; - ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; - ComputedPackagingRuleSkillCount += Skill.bSpecifiesPackagingRules ? 1 : 0; - ComputedEnableDisableGroupingSkillCount += - Skill.bSpecifiesEnableDisableGrouping ? 1 : 0; - bComputedEverySkillPreservesOptionalAssistiveOffState &= - Skill.bPreservesOptionalAssistiveOffState; - bComputedDomainPackFrameworkRemainsBounded &= - Skill.bBoundedToDomainPackFrameworkOnly; - bComputedEverySkillRequiresPlanOrchestrationSubstrate &= - Skill.bRequiresPlanOrchestrationSubstrate; - bComputedEverySkillRequiresProviderUsageOperationsAuditSubstrate &= - Skill.bRequiresProviderUsageOperationsAuditSubstrate; - bComputedPlaceholderDomainPackDeferralRemainsPreserved &= - Skill.bPreservesPlaceholderDomainPackDeferral; - bComputedNoRetainedDomainPackClaims &= - Skill.bAvoidsRetainedDomainPackClaims; - bComputedNoCreativeMediaWidening &= - Skill.bAvoidsCreativeMediaWidening; - - if (Skill.bLiveSkill) - { - bComputedEveryLiveSkillReadsAuthoritativeSkillAndFrameworkState &= - Skill.bReadsAuthoritativeSkillAndFrameworkState; - bComputedEveryLiveSkillHasValidationHarnessCoverage &= - Skill.bHasValidationHarnessCoverage; - } - } - - return LiveSkillCount == ComputedLiveSkillCount - && AvailableNowCount == ComputedAvailableNowCount - && PackagingRuleSkillCount == ComputedPackagingRuleSkillCount - && EnableDisableGroupingSkillCount - == ComputedEnableDisableGroupingSkillCount - && bEveryLiveSkillReadsAuthoritativeSkillAndFrameworkState - == bComputedEveryLiveSkillReadsAuthoritativeSkillAndFrameworkState - && bEverySkillPreservesOptionalAssistiveOffState - == bComputedEverySkillPreservesOptionalAssistiveOffState - && bEveryLiveSkillHasValidationHarnessCoverage - == bComputedEveryLiveSkillHasValidationHarnessCoverage - && bDomainPackFrameworkRemainsBounded - == bComputedDomainPackFrameworkRemainsBounded - && bEverySkillRequiresPlanOrchestrationSubstrate - == bComputedEverySkillRequiresPlanOrchestrationSubstrate - && bEverySkillRequiresProviderUsageOperationsAuditSubstrate - == bComputedEverySkillRequiresProviderUsageOperationsAuditSubstrate - && bPlaceholderDomainPackDeferralRemainsPreserved - == bComputedPlaceholderDomainPackDeferralRemainsPreserved - && bNoRetainedDomainPackClaims == bComputedNoRetainedDomainPackClaims - && bNoCreativeMediaWidening == bComputedNoCreativeMediaWidening; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -6476,86 +4522,7 @@ struct FHyperTwistSkillRetainedDomainPackSkill UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (SkillId.IsEmpty() - || DisplayLabel.IsEmpty() - || CommandSurfaceId.IsEmpty() - || ServiceBindingId.IsEmpty() - || OwnerLaneId.IsEmpty() - || OwnerFeatureId.IsEmpty() - || Status == EHyperTwistSkillStatus::None - || PermissionScopeIds.Num() == 0 - || SourceSurfaceIds.Num() == 0 - || RequiredDomainPackFrameworkSkillIds.Num() == 0 - || OutputArtifactKinds.Num() == 0 - || PreviewHeadlines.Num() == 0 - || SourceSurfaceCount != SourceSurfaceIds.Num() - || RequiredDomainPackFrameworkSkillCount - != RequiredDomainPackFrameworkSkillIds.Num() - || !bReadsAuthoritativeFirstPartyDomainState - || !bPreservesOptionalAssistiveOffState - || !bDerivedAssistiveOnly - || !bHasValidationHarnessCoverage - || !bBoundedToRetainedDomainPackOnly - || !bRequiresDomainPackFrameworkSubstrate - || !bPreservesFirstPartyRetainedPackGrounding - || !bPreservesUnlandedPackDeferral - || !bAvoidsCreativeAdjunctWidening) - { - return false; - } - - for (const FString& Value : PermissionScopeIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : SourceSurfaceIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : RequiredDomainPackFrameworkSkillIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : OutputArtifactKinds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : PreviewHeadlines) - { - if (Value.IsEmpty()) - { - return false; - } - } - - const int32 PackModeCount = - (bReadsTrainingReplayState ? 1 : 0) - + (bReadsCurriculumContentState ? 1 : 0) - + (bReadsMediaExportState ? 1 : 0); - return PackModeCount == 1 - && Status == EHyperTwistSkillStatus::ImplementedNow - && bLiveSkill - && bAvailableNow - && !bRequiresOwnerActivation; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -6626,104 +4593,7 @@ struct FHyperTwistSkillRetainedDomainPackState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (RegistryId.IsEmpty() - || ManifestVersion.IsEmpty() - || ReferenceUtc.IsEmpty() - || CommandSurfaceRootId.IsEmpty() - || TemplateVersion.IsEmpty() - || Skills.Num() == 0 - || SkillCount != Skills.Num() - || !bEveryLiveSkillReadsAuthoritativeFirstPartyDomainState - || !bEverySkillPreservesOptionalAssistiveOffState - || !bEveryLiveSkillHasValidationHarnessCoverage - || !bRetainedDomainPackLayerRemainsBounded - || !bEverySkillRequiresDomainPackFrameworkSubstrate - || !bRetainedPackClaimsRemainFirstPartyGrounded - || !bUnlandedPackDeferralRemainsPreserved - || !bNoCreativeAdjunctWidening) - { - return false; - } - - TArray SeenSkillIds; - int32 ComputedLiveSkillCount = 0; - int32 ComputedAvailableNowCount = 0; - int32 ComputedTrainingReplayPackSkillCount = 0; - int32 ComputedCurriculumContentPackSkillCount = 0; - int32 ComputedMediaExportPackSkillCount = 0; - bool bComputedEveryLiveSkillReadsAuthoritativeFirstPartyDomainState = true; - bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; - bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; - bool bComputedRetainedDomainPackLayerRemainsBounded = true; - bool bComputedEverySkillRequiresDomainPackFrameworkSubstrate = true; - bool bComputedRetainedPackClaimsRemainFirstPartyGrounded = true; - bool bComputedUnlandedPackDeferralRemainsPreserved = true; - bool bComputedNoCreativeAdjunctWidening = true; - - for (const FHyperTwistSkillRetainedDomainPackSkill& Skill : Skills) - { - if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) - { - return false; - } - - SeenSkillIds.Add(Skill.SkillId); - ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; - ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; - ComputedTrainingReplayPackSkillCount += - Skill.bReadsTrainingReplayState ? 1 : 0; - ComputedCurriculumContentPackSkillCount += - Skill.bReadsCurriculumContentState ? 1 : 0; - ComputedMediaExportPackSkillCount += - Skill.bReadsMediaExportState ? 1 : 0; - bComputedEverySkillPreservesOptionalAssistiveOffState &= - Skill.bPreservesOptionalAssistiveOffState; - bComputedRetainedDomainPackLayerRemainsBounded &= - Skill.bBoundedToRetainedDomainPackOnly; - bComputedEverySkillRequiresDomainPackFrameworkSubstrate &= - Skill.bRequiresDomainPackFrameworkSubstrate; - bComputedRetainedPackClaimsRemainFirstPartyGrounded &= - Skill.bPreservesFirstPartyRetainedPackGrounding; - bComputedUnlandedPackDeferralRemainsPreserved &= - Skill.bPreservesUnlandedPackDeferral; - bComputedNoCreativeAdjunctWidening &= - Skill.bAvoidsCreativeAdjunctWidening; - - if (Skill.bLiveSkill) - { - bComputedEveryLiveSkillReadsAuthoritativeFirstPartyDomainState &= - Skill.bReadsAuthoritativeFirstPartyDomainState; - bComputedEveryLiveSkillHasValidationHarnessCoverage &= - Skill.bHasValidationHarnessCoverage; - } - } - - return LiveSkillCount == ComputedLiveSkillCount - && AvailableNowCount == ComputedAvailableNowCount - && TrainingReplayPackSkillCount - == ComputedTrainingReplayPackSkillCount - && CurriculumContentPackSkillCount - == ComputedCurriculumContentPackSkillCount - && MediaExportPackSkillCount == ComputedMediaExportPackSkillCount - && bEveryLiveSkillReadsAuthoritativeFirstPartyDomainState - == bComputedEveryLiveSkillReadsAuthoritativeFirstPartyDomainState - && bEverySkillPreservesOptionalAssistiveOffState - == bComputedEverySkillPreservesOptionalAssistiveOffState - && bEveryLiveSkillHasValidationHarnessCoverage - == bComputedEveryLiveSkillHasValidationHarnessCoverage - && bRetainedDomainPackLayerRemainsBounded - == bComputedRetainedDomainPackLayerRemainsBounded - && bEverySkillRequiresDomainPackFrameworkSubstrate - == bComputedEverySkillRequiresDomainPackFrameworkSubstrate - && bRetainedPackClaimsRemainFirstPartyGrounded - == bComputedRetainedPackClaimsRemainFirstPartyGrounded - && bUnlandedPackDeferralRemainsPreserved - == bComputedUnlandedPackDeferralRemainsPreserved - && bNoCreativeAdjunctWidening - == bComputedNoCreativeAdjunctWidening; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -6821,86 +4691,7 @@ struct FHyperTwistSkillCreativeMediaPackSkill UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (SkillId.IsEmpty() - || DisplayLabel.IsEmpty() - || CommandSurfaceId.IsEmpty() - || ServiceBindingId.IsEmpty() - || OwnerLaneId.IsEmpty() - || OwnerFeatureId.IsEmpty() - || Status == EHyperTwistSkillStatus::None - || PermissionScopeIds.Num() == 0 - || SourceSurfaceIds.Num() == 0 - || RequiredRetainedDomainPackSkillIds.Num() == 0 - || OutputArtifactKinds.Num() == 0 - || PreviewHeadlines.Num() == 0 - || SourceSurfaceCount != SourceSurfaceIds.Num() - || RequiredRetainedDomainPackSkillCount - != RequiredRetainedDomainPackSkillIds.Num() - || !bReadsAuthoritativeFirstPartyCreativeMediaState - || !bPreservesOptionalAssistiveOffState - || !bDerivedAssistiveOnly - || !bHasValidationHarnessCoverage - || !bBoundedToCreativeMediaPackOnly - || !bRequiresRetainedDomainPackSubstrate - || !bCreativeMediaAdjunctOnly - || !bAvoidsCoreRuntimePromotion - || !bBoundarySensitiveLicensingRemainsExplicit) - { - return false; - } - - for (const FString& Value : PermissionScopeIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : SourceSurfaceIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : RequiredRetainedDomainPackSkillIds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : OutputArtifactKinds) - { - if (Value.IsEmpty()) - { - return false; - } - } - - for (const FString& Value : PreviewHeadlines) - { - if (Value.IsEmpty()) - { - return false; - } - } - - const int32 PackModeCount = - (bReadsReplayExplainerState ? 1 : 0) - + (bReadsMediaParserState ? 1 : 0) - + (bReadsSharedFixtureState ? 1 : 0); - return PackModeCount == 1 - && Status == EHyperTwistSkillStatus::ImplementedNow - && bLiveSkill - && bAvailableNow - && !bRequiresOwnerActivation; - } + bool IsStructurallyValid() const; }; USTRUCT(BlueprintType) @@ -6971,100 +4762,5 @@ struct FHyperTwistSkillCreativeMediaPackState UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist") FString Summary; - bool IsStructurallyValid() const - { - if (RegistryId.IsEmpty() - || ManifestVersion.IsEmpty() - || ReferenceUtc.IsEmpty() - || CommandSurfaceRootId.IsEmpty() - || TemplateVersion.IsEmpty() - || Skills.Num() == 0 - || SkillCount != Skills.Num() - || !bEveryLiveSkillReadsAuthoritativeFirstPartyCreativeMediaState - || !bEverySkillPreservesOptionalAssistiveOffState - || !bEveryLiveSkillHasValidationHarnessCoverage - || !bCreativeMediaPackLayerRemainsBounded - || !bEverySkillRequiresRetainedDomainPackSubstrate - || !bCreativeMediaAdjunctsRemainOptional - || !bNoCoreRuntimePromotion - || !bBoundarySensitiveLicensingRemainsExplicit) - { - return false; - } - - TArray SeenSkillIds; - int32 ComputedLiveSkillCount = 0; - int32 ComputedAvailableNowCount = 0; - int32 ComputedReplayExplainerPackSkillCount = 0; - int32 ComputedMediaParserPackSkillCount = 0; - int32 ComputedSharedFixturePackSkillCount = 0; - bool bComputedEveryLiveSkillReadsAuthoritativeFirstPartyCreativeMediaState = - true; - bool bComputedEverySkillPreservesOptionalAssistiveOffState = true; - bool bComputedEveryLiveSkillHasValidationHarnessCoverage = true; - bool bComputedCreativeMediaPackLayerRemainsBounded = true; - bool bComputedEverySkillRequiresRetainedDomainPackSubstrate = true; - bool bComputedCreativeMediaAdjunctsRemainOptional = true; - bool bComputedNoCoreRuntimePromotion = true; - bool bComputedBoundarySensitiveLicensingRemainsExplicit = true; - - for (const FHyperTwistSkillCreativeMediaPackSkill& Skill : Skills) - { - if (!Skill.IsStructurallyValid() || SeenSkillIds.Contains(Skill.SkillId)) - { - return false; - } - - SeenSkillIds.Add(Skill.SkillId); - ComputedLiveSkillCount += Skill.bLiveSkill ? 1 : 0; - ComputedAvailableNowCount += Skill.bAvailableNow ? 1 : 0; - ComputedReplayExplainerPackSkillCount += - Skill.bReadsReplayExplainerState ? 1 : 0; - ComputedMediaParserPackSkillCount += - Skill.bReadsMediaParserState ? 1 : 0; - ComputedSharedFixturePackSkillCount += - Skill.bReadsSharedFixtureState ? 1 : 0; - bComputedEverySkillPreservesOptionalAssistiveOffState &= - Skill.bPreservesOptionalAssistiveOffState; - bComputedCreativeMediaPackLayerRemainsBounded &= - Skill.bBoundedToCreativeMediaPackOnly; - bComputedEverySkillRequiresRetainedDomainPackSubstrate &= - Skill.bRequiresRetainedDomainPackSubstrate; - bComputedCreativeMediaAdjunctsRemainOptional &= - Skill.bCreativeMediaAdjunctOnly; - bComputedNoCoreRuntimePromotion &= Skill.bAvoidsCoreRuntimePromotion; - bComputedBoundarySensitiveLicensingRemainsExplicit &= - Skill.bBoundarySensitiveLicensingRemainsExplicit; - - if (Skill.bLiveSkill) - { - bComputedEveryLiveSkillReadsAuthoritativeFirstPartyCreativeMediaState &= - Skill.bReadsAuthoritativeFirstPartyCreativeMediaState; - bComputedEveryLiveSkillHasValidationHarnessCoverage &= - Skill.bHasValidationHarnessCoverage; - } - } - - return LiveSkillCount == ComputedLiveSkillCount - && AvailableNowCount == ComputedAvailableNowCount - && ReplayExplainerPackSkillCount - == ComputedReplayExplainerPackSkillCount - && MediaParserPackSkillCount == ComputedMediaParserPackSkillCount - && SharedFixturePackSkillCount == ComputedSharedFixturePackSkillCount - && bEveryLiveSkillReadsAuthoritativeFirstPartyCreativeMediaState - == bComputedEveryLiveSkillReadsAuthoritativeFirstPartyCreativeMediaState - && bEverySkillPreservesOptionalAssistiveOffState - == bComputedEverySkillPreservesOptionalAssistiveOffState - && bEveryLiveSkillHasValidationHarnessCoverage - == bComputedEveryLiveSkillHasValidationHarnessCoverage - && bCreativeMediaPackLayerRemainsBounded - == bComputedCreativeMediaPackLayerRemainsBounded - && bEverySkillRequiresRetainedDomainPackSubstrate - == bComputedEverySkillRequiresRetainedDomainPackSubstrate - && bCreativeMediaAdjunctsRemainOptional - == bComputedCreativeMediaAdjunctsRemainOptional - && bNoCoreRuntimePromotion == bComputedNoCoreRuntimePromotion - && bBoundarySensitiveLicensingRemainsExplicit - == bComputedBoundarySensitiveLicensingRemainsExplicit; - } + bool IsStructurallyValid() const; }; diff --git a/docs/ops/HYPERTWIST_REFACTORING_TOOLCHAIN_2026-06-22.md b/docs/ops/HYPERTWIST_REFACTORING_TOOLCHAIN_2026-06-22.md index cc71db0..146909c 100644 --- a/docs/ops/HYPERTWIST_REFACTORING_TOOLCHAIN_2026-06-22.md +++ b/docs/ops/HYPERTWIST_REFACTORING_TOOLCHAIN_2026-06-22.md @@ -20,6 +20,7 @@ VectorShell. ## Landed HyperTwist-owned entry points - `.sentrux/rules.toml` +- `scripts/bootstrap-hypertwist-sentrux.sh` - `scripts/run-hypertwist-sentrux-source-only.sh` - `scripts/run-hypertwist-gitnexus-analyze.sh` - `scripts/run-hypertwist-gitnexus-status.sh` @@ -56,9 +57,16 @@ Resolution order for the analyzer binary is now HyperTwist-owned first: - `HYPERTWIST_SENTRUX_BINARY` if explicitly provided - repo-local `./sentrux` or `./sentrux.exe` if present +- repo-local `tools/sentrux/bin/sentrux` or `tools/sentrux/bin/sentrux.exe` - `sentrux` on `PATH` - the retained local fallback under `/home/dev/src/VectorShell/sentrux` +If the repo-local tools path is empty, materialize it with: + +```bash +scripts/bootstrap-hypertwist-sentrux.sh +``` + Current rules enforce: - no cycles @@ -237,6 +245,129 @@ Important nuance from the `2026-06-22` follow-up: family extraction or multi-header ownership separation for the remaining validator clusters rather than more in-place header-local helperization +## `2026-06-23` continuation refresh + +Additional same-lane follow-up on `2026-06-23`: + +- the remaining inline validator clusters in + `HyperTwistSkillTypes.h` and `HyperTwistRecognitionTypes.h` were then moved + further out of the public headers into dedicated private translation units: + - `UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistSkills/HyperTwistSkillTypes.cpp` + - `UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistRecognition/HyperTwistRecognitionTypes.cpp` +- a public-website/manual continuation also landed in the same pass so the + docs/resources/support surfaces now explicitly project current keyboard, + higher-dimensional control, and unfinished XR/controller truth instead of + only the browser-versus-desktop topology boundary +- focused website coverage for + `src/__tests__/public-marketing-pages.test.tsx` and + `src/__tests__/protected-app-pages.test.tsx` passed after that public-manual + continuation +- a fresh full website validation pass then stayed green: + - `npm --prefix website test -- --run` + - `37` test files passed + - `137` tests passed +- the same widened public-manual packet also kept the production website build + green under `npm --prefix website run build` + +Current highest-signal structural truth after that `2026-06-23` continuation: + +- `scripts/run-hypertwist-sentrux-source-only.sh` now reports `Quality: 6070` +- the only remaining reported `sentrux` debt is still: + - `UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistRecognition/HyperTwistRecognitionTypes.h:IsStructurallyValid (308 lines)` +- that remaining hit is now more likely a parser/grouping artifact than a new + broad website or browser regression, because the website/manual widening + stayed structurally clean and the real validator ownership was moved out of + the header family rather than expanded inside it + +Additional same-lane follow-up later on `2026-06-23`: + +- `scripts/run-hypertwist-gitnexus-analyze.sh` re-indexed the bounded + source-only mirror successfully at `16,042` nodes, `37,412` edges, + `643` clusters, and `300` flows +- `scripts/run-hypertwist-gitnexus-status.sh` again reported the bounded + mirror `Status: up-to-date` +- a fresh full website validation rerun stayed green again: + - `npm --prefix website test -- --run` + - `37` test files passed + - `137` tests passed + - duration `4.63s` + - `npm --prefix website run build` + - Vite production build succeeded +- `scripts/run-hypertwist-sentrux-source-only.sh` improved again to + `Quality: 6076` +- one more out-of-header migration moved + `FHyperTwistSpeechExternalDictationShellProfile::IsStructurallyValid()` + into `Private/HyperTwistRecognition/HyperTwistRecognitionTypes.cpp` +- the same remaining reported `sentrux` hit still stayed fixed at + `HyperTwistRecognitionTypes.h:IsStructurallyValid (308 lines)` even after + that migration, which further supports the current interpretation that this + residual is a repeated-name/grouping artifact inside the analyzer rather + than one newly expanded high-risk validator body +- the public-website lane was then refactored into bounded per-page modules so + the website manual/distribution surface is no longer concentrated in one + large `public-pages.tsx` owner +- the public route tree then stopped lazy-loading the old barrel and now loads + `public-pages-marketing` and `public-pages-commerce` directly, which restored + real route-level bundle separation instead of keeping one coarse public-pages + chunk +- HyperTwist also gained a repo-local `scripts/bootstrap-hypertwist-sentrux.sh` + helper plus `tools/sentrux/bin/` landing zone so the analyzer path can be + materialized under HyperTwist authority instead of depending only on + cross-repo memory +- after that same refactor/tooling continuation, the repo-local materialized + analyzer reran successfully through + `scripts/run-hypertwist-sentrux-source-only.sh` at `Quality: 6032` +- the same single residual violation remained: + `HyperTwistRecognitionTypes.h:IsStructurallyValid (308 lines)` +- that lower numeric score did not reopen cycle debt or website/page-module + god-file debt; it still reported the same one residual recognition-header hit + and no new browser/website structural regression + +Latest same-lane follow-up later on `2026-06-23`: + +- the remaining repeated-name recognition validator hotspot was then reduced + again by moving these larger header-local validators into + `Private/HyperTwistRecognition/HyperTwistRecognitionTypes.cpp`: + - `FHyperTwistVisionShellProfile::IsStructurallyValid()` + - `FHyperTwistVisionSolveExplanationProfile::IsStructurallyValid()` + - `FHyperTwistVisionCorrectionState::IsStructurallyValid()` + - `FHyperTwistSpeechProviderRoutingPolicy::IsStructurallyValid()` +- after that out-of-header continuation, + `scripts/run-hypertwist-sentrux-source-only.sh` reached `Quality: 6112` + and all `7` rules passed with no remaining violations +- `scripts/run-hypertwist-gitnexus-analyze.sh` then re-indexed the bounded + source-only mirror successfully at `16,055` nodes, `37,472` edges, + `645` clusters, and `300` flows +- `scripts/run-hypertwist-gitnexus-status.sh` again reported the bounded + mirror `Status: up-to-date` +- the tightened public/manual route split remained green under focused website + validation: + - `npm test -- --run src/__tests__/public-marketing-pages.test.tsx src/__tests__/protected-app-pages.test.tsx` + - `2` test files passed + - `11` tests passed +- the production website build remained green under `npm run build` in + `website/` +- the embedded browser runtime verification and production build also remained + green under: + - `npm run verify:shell` in `Content/Browser/` + - `npm run build` in `Content/Browser/` +- the same lane also preserved remote validation truth for the repaired skill + fixture packet: + - all `9` Windows Unreal automation reports under + `Skill-S3-Full-PostFixture-*` were present + - every report recorded `Succeeded: true` + - the green set covered `S3A`, `S3B`, and `S3C` continuity, authoritative, + and serialization filters + +Current highest-signal structural truth after this latest continuation: + +- HyperTwist now has repo-owned `sentrux` and `GitNexus` entry points that are + both revalidated and green on the bounded source-only mirror +- the public/manual/browser lane stayed validation-clean while the Unreal + validator ownership was pushed farther out of public headers +- the repaired skill-memory fixture lane is now fully green on the real remote + Windows Unreal path across all `9` focused `S3` reports + ## Out of scope This note does not: diff --git a/docs/ops/HYPERTWIST_REVERSE_SSH_WINDOWS_BUILD_LANE_VERIFICATION_2026-06-01.md b/docs/ops/HYPERTWIST_REVERSE_SSH_WINDOWS_BUILD_LANE_VERIFICATION_2026-06-01.md index 3f47a3e..0e9e31f 100644 --- a/docs/ops/HYPERTWIST_REVERSE_SSH_WINDOWS_BUILD_LANE_VERIFICATION_2026-06-01.md +++ b/docs/ops/HYPERTWIST_REVERSE_SSH_WINDOWS_BUILD_LANE_VERIFICATION_2026-06-01.md @@ -50,6 +50,15 @@ Fallback connect-back shape when `22022` is occupied or stale: ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no -o StrictHostKeyChecking=accept-new -o ConnectTimeout=10 -p 22023 -l 'DESKTOP-KS3VGHU\\anthracite ace' localhost ``` +Verified helper shape for short Windows-side PowerShell diagnostics on the same +lane: + +```bash +HYPERTWIST_REMOTE_WINDOWS_PASSWORD='...' \ +scripts/run-hypertwist-remote-windows-powershell.sh \ + --command 'Write-Output ("ComputerName=" + $env:COMPUTERNAME)' +``` + ## Current Linux-side pickup sequence For a HyperTwist AI session that starts on Linux and needs to pick up the live @@ -148,6 +157,27 @@ Live follow-up on `2026-06-04` established these current facts: - `22023` and `22024` were not visible in the latest probe and should be treated as unavailable until re-established - live `whoami` over `22022` again returned `desktop-ks3vghu\anthracite ace` +- the repo now also carries + `scripts/run-hypertwist-remote-windows-powershell.sh` as a bounded encoded- + PowerShell wrapper for the reverse-SSH lane so future sessions can run short + diagnostics or automation commands through `localhost:22022` without brittle + nested shell quoting +- the repo now also carries + `scripts/run-hypertwist-remote-unreal-automation.sh` as a thin first-party + helper that builds canonical `UnrealEditor-Cmd` automation invocations on top + of that encoded-PowerShell wrapper for the maintained + `C:\HyperTwist_worktrees\phase10validate` lane +- the repo now also carries + `scripts/run-hypertwist-remote-unreal-automation-sequence.sh` as a thin + first-party fail-fast helper for short ordered batches of focused automation + reruns on that same maintained validation lane +- the repo now also carries + `scripts/run-hypertwist-remote-unreal-build.sh` as a thin first-party helper + that builds canonical `Build.bat` invocations on top of that same encoded- + PowerShell wrapper for the maintained + `C:\HyperTwist_worktrees\phase10validate` lane, with the currently verified + reverse-lane low-memory posture `-NoUBA -MaxParallelActions=2` as its + default build shape The sensitive runbook now carries the exact current Windows-side tunnel commands, known-hosts scratch file, listener verification command, reverse-sync @@ -564,6 +594,41 @@ Operational rules reinforced by this proof: - when the export helper reports success, do one lightweight media sanity check on the canonical MP4 rather than trusting file existence alone; current proof used `ffprobe` to confirm codec, resolution, frame count, and duration +- when the refreshed reverse-SSH Windows lane only has about `1.2 GB` of free + physical memory and the host is still carrying large resident + `chrome.exe` / `Code.exe` workloads, expect UnrealBuildTool to fall back to + one active compiler worker; that is a slow-but-healthy memory-pressure + condition, not by itself proof of tunnel corruption or a looping build +- when a future session needs a short bounded PowerShell diagnostic over the + reverse-SSH lane, prefer + `scripts/run-hypertwist-remote-windows-powershell.sh` over ad hoc nested + shell quoting; the wrapper was re-proved on `2026-06-23` against the live + `22022` lane with `ComputerName=DESKTOP-KS3VGHU` +- when a future session needs a focused `UnrealEditor-Cmd` automation rerun on + the maintained Windows lane, prefer + `scripts/run-hypertwist-remote-unreal-automation.sh`; its generated command + shape was dry-run-validated on `2026-06-23` for + `HyperTwist.FirstParty.Skill` before the next live post-build invocation +- when that future session instead needs a short ordered batch of those focused + automation reruns, prefer + `scripts/run-hypertwist-remote-unreal-automation-sequence.sh`; its generated + command shape was dry-run-validated on `2026-06-23` + +Additional `2026-06-23` lane truth: + +- the primary tunnel on `localhost:22022` remained healthy for a same-lane + skill-memory repair continuation +- the isolated Windows build root again stayed + `C:\HyperTwist_worktrees\phase10validate` +- a safe narrow-sync route was re-proved from the Windows side by using the + remote host's own `scp.exe` plus the retained VPS key to pull changed files + directly from `root@212.227.13.220` into that isolated worktree +- that route is now suitable when the active lane needs only a few touched + Unreal files refreshed in the maintained validation tree and a broad + reverse-sync would be wasteful or riskier than necessary +- after that narrow sync, the authoritative incremental Unreal editor rebuild + succeeded and the widened `S3` skill-memory automation packet finished with + all `9` expected `Skill-S3-Full-PostFixture-*` reports present and green ## Addendum - 2026-06-03 (stale-listener recovery) diff --git a/docs/ops/HYPERTWIST_UNREAL_BUILD_VALIDATION_REQUIREMENT_2026-06-01.md b/docs/ops/HYPERTWIST_UNREAL_BUILD_VALIDATION_REQUIREMENT_2026-06-01.md index 3ac09d6..2776b75 100644 --- a/docs/ops/HYPERTWIST_UNREAL_BUILD_VALIDATION_REQUIREMENT_2026-06-01.md +++ b/docs/ops/HYPERTWIST_UNREAL_BUILD_VALIDATION_REQUIREMENT_2026-06-01.md @@ -267,6 +267,55 @@ Operational reading: it as stale and shift to `localhost:22023` - if `22023` is not visibly listening, do not assume fallback availability; re-establish it first or report that only the primary lane is currently live +- when a short bounded Windows-side PowerShell diagnostic or automation command + is needed from Linux over the tunnel, prefer + `scripts/run-hypertwist-remote-windows-powershell.sh` over ad hoc nested + shell quoting; the wrapper encodes the payload for `powershell -EncodedCommand` + and was re-proved against the live `22022` lane on `2026-06-23` +- when the next step is a focused `UnrealEditor-Cmd` automation rerun on the + maintained Windows worktree, prefer + `scripts/run-hypertwist-remote-unreal-automation.sh`; it composes canonical + `-NullRHI`, `-ReportExportPath`, `-AbsLog`, and single-filter + `Automation RunTests ...; Quit` invocations on top of that encoded- + PowerShell wrapper, and its generated command shape was dry-run-validated on + `2026-06-23` +- when the next step is a short ordered batch of focused automation reruns on + that same maintained Windows worktree, prefer + `scripts/run-hypertwist-remote-unreal-automation-sequence.sh`; it composes + repeated fail-fast invocations of the single-filter wrapper in the exact + order provided, and its generated command shape was dry-run-validated on + `2026-06-23` +- when the next step is the authoritative remote Unreal editor build itself on + the maintained Windows worktree, prefer + `scripts/run-hypertwist-remote-unreal-build.sh`; it composes the verified + `Build.bat` invocation on top of that same encoded-PowerShell wrapper, + defaults the reverse-SSH lane to the maintained + `C:\HyperTwist_worktrees\phase10validate` root, and bakes in the + currently-verified low-memory recovery posture `-NoUBA -MaxParallelActions=2` + unless explicitly overridden. Its generated command shape was dry-run- + validated on `2026-06-23` + +Canonical helper shape for the next focused post-build reruns: + +```bash +HYPERTWIST_REMOTE_WINDOWS_PASSWORD='...' \ +scripts/run-hypertwist-remote-unreal-automation.sh \ + --filter HyperTwist.FirstParty.Skill \ + --report-name Skill-Verify + +HYPERTWIST_REMOTE_WINDOWS_PASSWORD='...' \ +scripts/run-hypertwist-remote-unreal-automation.sh \ + --filter HyperTwist.Permissive.WhisperCpp \ + --report-name WhisperCpp-Verify + +HYPERTWIST_REMOTE_WINDOWS_PASSWORD='...' \ +scripts/run-hypertwist-remote-unreal-automation-sequence.sh \ + --report-prefix Skill-S3 \ + --filter HyperTwist.FirstParty.Skill.PhaseS3A.ContinuityResumeCoverage \ + --filter HyperTwist.FirstParty.Skill.PhaseS3A.AuthoritativeStoreRead \ + --filter HyperTwist.FirstParty.Skill.PhaseS3A.SerializationRoundTrip +``` + - when recovering from a stale listener, run a split sequence: 1. smoke login/identity check 2. canonical Unreal build command with explicit result markers @@ -305,11 +354,52 @@ Operational reading: before building; preserving old mtimes can leave stale `Intermediate\Build\Win64\UnrealEditor\Inc\UnrealHyperTwist` outputs in place and surface misleading reflected-type or generated-header failures +- when the reverse-SSH Windows lane only has about `1.2 GB` of free physical + memory and the host still has large resident `chrome.exe` / `Code.exe` + workloads, expect UnrealBuildTool to serialize down to one active compiler + worker; treat that as a slow-but-healthy memory-pressure condition rather than + as tunnel corruption or a looping build unless the compile output itself + stalls or errors - when a logical slice authors new `.umap` or `.uasset` authority surfaces in an isolated Windows worktree, pull those assets back into the tracked repo before calling the slice landed; remote-only authored assets are validation evidence, not final repo truth +## Addendum - 2026-06-23 (skill-memory fixture repair and full `S3` proof) + +Live follow-up on `2026-06-23` established these additional facts: + +- the maintained validation root again stayed + `C:\HyperTwist_worktrees\phase10validate` +- Windows-side `scp.exe` running on the remote host was re-proved as a safe + narrow-sync route from the VPS into that isolated worktree for touched + source files, avoiding a broad reverse-sync just to refresh a few Unreal + translation units +- after the touched skill-memory source files were hash-matched into that + worktree, the authoritative incremental editor rebuild succeeded there with + `Result: Succeeded` and UnrealBuildTool `Total execution time: 104.88 + seconds` +- a fresh focused `S3A` rerun then passed on that rebuilt binary +- the widened same-lane follow-up then produced all `9` expected + `Skill-S3-Full-PostFixture-*` automation report folders under + `Saved\AutomationReports` +- each of those `9` report `index.json` files recorded a green result with + `Succeeded: true`, `SucceededCount: 1`, and `FailedCount: 0` +- that green set covered: + - `HyperTwist.FirstParty.Skill.PhaseS3A.ContinuityResumeCoverage` + - `HyperTwist.FirstParty.Skill.PhaseS3A.AuthoritativeStoreRead` + - `HyperTwist.FirstParty.Skill.PhaseS3A.SerializationRoundTrip` + - `HyperTwist.FirstParty.Skill.PhaseS3B.RecallCompactViewCoverage` + - `HyperTwist.FirstParty.Skill.PhaseS3B.AuthoritativeCompactViewLinkage` + - `HyperTwist.FirstParty.Skill.PhaseS3B.SerializationRoundTrip` + - `HyperTwist.FirstParty.Skill.PhaseS3C.WorkflowMemoryCaptureCoverage` + - `HyperTwist.FirstParty.Skill.PhaseS3C.AuthoritativeWorkflowCaptureBoundaries` + - `HyperTwist.FirstParty.Skill.PhaseS3C.SerializationRoundTrip` + +This extends the doctrine from classic-cube, package, higher-dimensional, and +media-export proof into the real remote skill-memory validation lane on the +same maintained reverse-SSH path. + ## Closeout wording requirement Every Unreal C++ closeout should say one of these explicitly: diff --git a/docs/ops/HYPERTWIST_UNREAL_INPUT_AND_XR_COMPLETENESS_AUDIT_2026-06-22.md b/docs/ops/HYPERTWIST_UNREAL_INPUT_AND_XR_COMPLETENESS_AUDIT_2026-06-22.md index c820fe6..b552db4 100644 --- a/docs/ops/HYPERTWIST_UNREAL_INPUT_AND_XR_COMPLETENESS_AUDIT_2026-06-22.md +++ b/docs/ops/HYPERTWIST_UNREAL_INPUT_AND_XR_COMPLETENESS_AUDIT_2026-06-22.md @@ -71,6 +71,18 @@ Current truthful product wording should say: - full VR/controller/settings polish lane: not yet complete enough to market as finished +## Public-surface consequence + +The same truth should remain visible on the public website and public operator +manual: + +- docs/resources/support surfaces should explicitly distinguish current keyboard + and higher-dimensional control ownership from unfinished VR/controller claims +- public copy should not imply that `EnhancedInput` plus motion-controller axis + groundwork already equals a finished OpenXR/runtime or rebinding lane +- browser/distribution pages may describe the simulator input posture, but they + must not market browser control parity with the native runtime + ## Next clean implementation packet If the project wants to raise this lane from “groundwork exists” to “shipping diff --git a/docs/v6_5_deep_manual_pack/HyperTwist/FEATURE_REGISTRY.md b/docs/v6_5_deep_manual_pack/HyperTwist/FEATURE_REGISTRY.md index 7071adf..bafd41e 100644 --- a/docs/v6_5_deep_manual_pack/HyperTwist/FEATURE_REGISTRY.md +++ b/docs/v6_5_deep_manual_pack/HyperTwist/FEATURE_REGISTRY.md @@ -229,6 +229,7 @@ repo. | Smartcube-aware practice-shell and review/SRS UX comparison | Deep-source grounded retained | `poliva/cubedex` restrictive reference row | Retained as `A1 + R4 + F2` only for smartcube-aware practice-shell comparison, offline-first drill UX composition, review/SRS workflow presentation, recognition-versus-execution timing presentation, and local stats/history comparison. This does not displace the current first-party training-session, review-plan, coaching, `KubeTimr` timer substrate, `CubeDesk` smart-device workflow composition, or the landed permissive trainer-foundation lanes. | | Scenic virtual training environments and focus-presence shells | Implemented now | landed first-party `Phase I-A` through `Phase I-E` scaffold | Current code now owns the first bounded HyperTwist-native immersive foundation, focus-presence, teaching, reactive-cue, and hardening slices: scenic environment profile, legibility-first lighting preset boundary, calm ambient-audio boundary, stable puzzle/replay/coach world anchors, intensity and reduced-distraction controls, comfort/vignette posture, seated-standing posture variants, session-local environment recall, coach cue anchors, ghost targets, replay emphasis, lesson-state spotlighting, session-state transition cues, pacing-aware lighting and audio responses, study-versus-challenge differentiation, comfort-safe transition rules, accessibility-legibility review, performance-budget posture, and reduced-effects fallback modes. This remains a training/runtime lane rather than a generic virtual desktop shell. | | Replay integrity and validation benchmark foundations | Implemented now | landed first-party `Phase J-A`, `Phase J-B`, `Phase J-C`, `Phase J-D`, `Phase J-E`, `Phase J-F`, `Phase J-G`, `Phase J-H`, `Phase J-I`, `Phase J-J`, `Phase J-K`, `Phase J-L`, `Phase J-M`, `Phase J-N`, `Phase J-O`, `Phase J-P`, `Phase J-Q`, `Phase J-R`, `Phase J-S`, `Phase J-T`, `Phase J-U`, `Phase J-V`, `Phase J-W`, `Phase J-X`, `Phase J-Y`, `Phase J-Z`, `Phase J-AA`, `Phase J-AB`, `Phase J-AC`, `Phase J-AD`, `Phase J-AE`, `Phase J-AF`, `Phase J-AG`, `Phase J-AH`, `Phase J-AI`, `Phase J-AJ`, `Phase J-AK`, `Phase J-AL`, `Phase J-AM`, `Phase J-AN`, `Phase J-AO`, `Phase J-AP`, `Phase J-AQ`, `Phase J-AR`, `Phase J-AS`, `Phase J-AT`, `Phase J-AU`, `Phase J-AV`, `Phase J-AW`, `Phase J-AX`, `Phase J-AY`, `Phase J-AZ`, `Phase J-BA`, `Phase J-BB`, `Phase J-BC`, `Phase J-BD`, `Phase J-BE`, `Phase J-BF`, `Phase J-BG`, `Phase J-BH`, `Phase J-BI`, `Phase J-BJ`, `Phase J-BK`, `Phase J-BL`, `Phase J-BM`, `Phase J-BN`, `Phase J-BO`, `Phase J-BP`, `Phase J-BQ`, `Phase J-BR`, `Phase J-BS`, `Phase J-BT`, `Phase J-BU`, `Phase J-BV`, `Phase J-BW`, `Phase J-BX`, `Phase J-BY`, `Phase J-BZ`, `Phase J-CA`, `Phase J-CB`, `Phase J-CC`, `Phase J-CD`, `Phase J-CE`, `Phase J-CF`, `Phase J-CG`, `Phase J-CH`, `Phase J-CI`, `Phase J-CJ`, `Phase J-CK`, `Phase J-CL`, `Phase J-CM`, `Phase J-CN`, `Phase J-CO`, `Phase J-CP`, `Phase J-CQ`, `Phase J-CR`, `Phase J-CS`, `Phase J-CT`, `Phase J-CU`, `Phase J-CV`, `Phase J-CW`, `Phase J-CX`, `Phase J-CY`, `Phase J-CZ`, `Phase J-DA`, `Phase J-DB`, `Phase J-DC`, `Phase J-DD`, `Phase J-DE`, `Phase J-DF`, `Phase J-DG`, `Phase J-DH`, `Phase J-DI`, `Phase J-DJ`, `Phase J-DK`, `Phase J-DL`, `Phase J-DM`, `Phase J-DN`, `Phase J-DO`, `Phase J-DP`, `Phase J-DQ`, `Phase J-DR`, `Phase J-DS`, `Phase J-DT`, `Phase J-DU`, `Phase J-DV`, `Phase J-DW`, `Phase J-DX`, `Phase J-DY`, `Phase J-DZ`, `Phase J-EA`, `Phase J-EB`, `Phase J-EC`, `Phase J-ED`, `Phase J-EE`, `Phase J-EF`, `Phase J-EG`, `Phase J-EH`, `Phase J-EI`, `Phase J-EJ`, `Phase J-EK`, `Phase J-EL`, `Phase J-EM`, `Phase J-EN`, `Phase J-EO`, `Phase J-EP`, `Phase J-EQ`, `Phase J-ER`, `Phase J-ES`, `Phase J-ET`, `Phase J-EU`, `Phase J-EV`, `Phase J-EW`, `Phase J-EX`, `Phase J-EY`, `Phase J-EZ`, `Phase J-FA`, `Phase J-FB`, `Phase J-FC`, `Phase J-FD`, `Phase J-FE`, `Phase J-FF`, `Phase J-FG`, `Phase J-FH`, `Phase J-FI`, `Phase J-FJ`, `Phase J-FK`, `Phase J-FL`, `Phase J-FM`, `Phase J-FN`, `Phase J-FO`, `Phase J-FP`, `Phase J-FQ`, `Phase J-FR`, `Phase J-FS`, `Phase J-FT`, `Phase J-FU`, `Phase J-FV`, `Phase J-FW`, `Phase J-FX`, `Phase J-FY`, `Phase J-FZ`, `Phase J-GA`, `Phase J-GB`, `Phase J-GC`, `Phase J-GD`, `Phase J-GE`, `Phase J-GF`, `Phase J-GG`, `Phase J-GH`, `Phase J-GI`, `Phase J-GJ`, `Phase J-GK`, `Phase J-GL`, `Phase J-GM`, `Phase J-GN`, `Phase J-GO`, `Phase J-GP`, `Phase J-GQ`, `Phase J-GR`, `Phase J-GS`, `Phase J-GT`, `Phase J-GU`, `Phase J-GV`, `Phase J-GW`, `Phase J-GX`, `Phase J-GY`, `Phase J-GZ`, `Phase J-HA`, and `Phase J-HB`, `Phase J-HC`, `Phase J-HD`, `Phase J-HE`, `Phase J-HF`, `Phase J-HG` packets | Current code now owns the first bounded HyperTwist-native validation and benchmarking substrate: replay-integrity contract, puzzle-state validation contract, repeatable benchmark-profile boundary, validation-scorecard contract, regression-snapshot contract, cross-run benchmark-delta boundary, validation-evidence export contract, benchmark-fixture packet boundary, validation-run-summary contract, operator-review packet boundary, validation-triage queue contract, manual sign-off note boundary, validation-exception waiver contract, validation-handoff closure boundary, validation-carry-forward ledger contract, reviewer-continuity digest boundary, validation-disposition snapshot contract, validation-reopen note boundary, validation-deferred follow-up bundle contract, validation-revisit cue boundary, validation-revisit completion receipt contract, validation-pending-state clearance boundary, validation-dormant-state ledger contract, validation-resurfacing cue boundary, validation-return-readiness packet contract, validation-wake-state confirmation boundary, validation-resumed-state checkpoint contract, validation-continuation-attestation boundary, validation-stable-state ledger contract, validation-continuation-state digest boundary, validation-settled-state packet contract, validation-ongoing-state confirmation boundary, validation-persistent-state ledger contract, validation-ongoing-state acknowledgement boundary, validation-durable-state packet contract, validation-ongoing-state attestation boundary, validation-enduring-state ledger contract, validation-ongoing-state certification boundary, validation-sustained-state packet contract, validation-ongoing-state assurance boundary, validation-anchored-state ledger contract, validation-ongoing-state affirmation boundary, validation-grounded-state packet contract, validation-ongoing-state endorsement boundary, validation-rooted-state ledger contract, validation-ongoing-state ratification boundary, validation-embedded-state packet contract, validation-ongoing-state reconciliation boundary, validation-nested-state ledger contract, validation-ongoing-state harmonization boundary, validation-layered-state packet contract, validation-ongoing-state alignment boundary, validation-stacked-state ledger contract, validation-ongoing-state convergence boundary, validation-composite-state packet contract, validation-ongoing-state synthesis boundary, validation-aggregated-state ledger contract, validation-ongoing-state consolidation boundary, validation-integrated-state packet contract, validation-ongoing-state unification boundary, validation-fused-state ledger contract, validation-ongoing-state coherence boundary, validation-merged-state packet contract, validation-ongoing-state concordance boundary, validation-blended-state ledger contract, validation-ongoing-state correspondence boundary, validation-interlaced-state packet contract, validation-ongoing-state affinity boundary, validation-woven-state ledger contract, validation-ongoing-state resonance boundary, validation-knotted-state packet contract, validation-ongoing-state harmonic boundary, validation-braided-state ledger contract, validation-ongoing-state cadence boundary, validation-looped-state packet contract, validation-ongoing-state refrain boundary, validation-spiraled-state ledger contract, validation-ongoing-state chorus boundary, validation-coiled-state packet contract, validation-ongoing-state reprise boundary, validation-helixed-state ledger contract, validation-ongoing-state echo boundary, validation-twisted-state packet contract, validation-ongoing-state reflection boundary, validation-wound-state ledger contract, validation-ongoing-state reverberation boundary, validation-folded-state packet contract, validation-ongoing-state aftertone boundary, validation-creased-state ledger contract, validation-ongoing-state residue boundary, validation-pleated-state packet contract, validation-ongoing-state remnant boundary, validation-crimped-state ledger contract, validation-ongoing-state imprint boundary, validation-corrugated-state packet contract, validation-ongoing-state trace boundary, validation-ribbed-state ledger contract, validation-ongoing-state signature boundary, validation-fluted-state packet contract, validation-ongoing-state mark boundary, validation-grooved-state ledger contract, validation-ongoing-state seal boundary, validation-ridged-state packet contract, validation-ongoing-state stamp boundary, validation-terraced-state ledger contract, validation-ongoing-state impression boundary, validation-buttressed-state packet contract, validation-ongoing-state etching boundary, validation-bastioned-state ledger contract, validation-ongoing-state engraving boundary, validation-fortified-state packet contract, validation-ongoing-state carving boundary, validation-bulwarked-state ledger contract, validation-ongoing-state inscription boundary, validation-rampart-state packet contract, validation-ongoing-state marking boundary, validation-citadel-state ledger contract, validation-ongoing-state tracing boundary, validation-keep-state packet contract, validation-ongoing-state notation boundary, validation-stronghold-state ledger contract, validation-ongoing-state annotation boundary, validation-watchtower-state packet contract, validation-ongoing-state gloss boundary, validation-battlement-state ledger contract, validation-ongoing-state caption boundary, validation-parapet-state packet contract, validation-ongoing-state legend boundary, validation-merlon-state ledger contract, validation-ongoing-state callout boundary, validation-crenel-state packet contract, validation-ongoing-state marginalia boundary, validation-embrasure-state ledger contract, validation-ongoing-state sidenote boundary, validation-machicolation-state packet contract, validation-ongoing-state footnote boundary, validation-bartizan-state ledger contract, validation-ongoing-state endnote boundary, validation-turret-state packet contract, validation-ongoing-state addendum boundary, validation-barbican-state ledger contract, validation-ongoing-state appendix boundary, validation-gatehouse-state packet contract, validation-ongoing-state codicil boundary, validation-portcullis-state ledger contract, validation-ongoing-state postscript boundary, validation-drawbridge-state packet contract, validation-ongoing-state afterword boundary, validation-moat-state ledger contract, validation-ongoing-state epilogue boundary, validation-causeway-state packet contract, validation-ongoing-state coda boundary, validation-viaduct-state ledger contract, validation-ongoing-state encore boundary, validation-aqueduct-state packet contract, validation-ongoing-state finale boundary, validation-trestle-state ledger contract, validation-ongoing-state curtain-call boundary, validation-span-state packet contract, validation-ongoing-state bow boundary, validation-arch-state ledger contract, validation-ongoing-state ovation boundary, validation-vault-state packet contract, validation-ongoing-state applause boundary, validation-keystone-state ledger contract, validation-ongoing-state acclamation boundary, validation-abutment-state packet contract, validation-ongoing-state commendation boundary, validation-pier-state ledger contract, validation-ongoing-state tribute boundary, validation-footing-state packet contract, validation-ongoing-state homage boundary, validation-pilaster-state ledger contract, validation-ongoing-state salute boundary, validation-column-state packet contract, validation-ongoing-state accolade boundary, validation-capital-state ledger contract, validation-ongoing-state plaudit boundary, validation-frieze-state packet contract, validation-ongoing-state laurel boundary, validation-cornice-state ledger contract, validation-ongoing-state honor boundary, validation-pediment-state packet contract, validation-ongoing-state distinction boundary, validation-entablature-state ledger contract, validation-ongoing-state recognition boundary, validation-architrave-state packet contract, validation-ongoing-state appreciation boundary, validation-metope-state ledger contract, validation-ongoing-state admiration boundary, validation-triglyph-state packet contract, validation-ongoing-state esteem boundary, validation-regula-state ledger contract, validation-ongoing-state regard boundary, validation-guttae-state packet contract, validation-ongoing-state respect boundary, validation-mutule-state ledger contract, validation-ongoing-state deference boundary, validation-taenia-state packet contract, validation-ongoing-state reverence boundary, validation-cymatium-state ledger contract, validation-ongoing-state veneration boundary, validation-sima-state packet contract, validation-ongoing-state devotion boundary, validation-corona-state ledger contract, validation-ongoing-state adoration boundary, validation-soffit-state packet contract, validation-ongoing-state praise boundary, validation-fascia-state ledger contract, validation-ongoing-state exaltation boundary, validation-fillet-state packet contract, validation-ongoing-state glorification boundary, validation-bead-state ledger contract, validation-ongoing-state celebration boundary, validation-ovolo-state packet contract, validation-ongoing-state jubilation boundary, validation-cavetto-state ledger contract, validation-ongoing-state rejoicing boundary, validation-torus-state packet contract, validation-ongoing-state exultation boundary, validation-scotia-state ledger contract, validation-ongoing-state elation boundary, validation-cyma-state packet contract, validation-ongoing-state delight boundary, validation-astragal-state ledger contract, validation-ongoing-state gladness boundary, validation-trochilus-state packet contract, validation-ongoing-state cheer boundary, validation-annulet-state ledger contract, validation-ongoing-state joy boundary, validation-listel-state packet contract, validation-ongoing-state merriment boundary, validation-cincture-state ledger contract, validation-ongoing-state gaiety boundary, validation-girdle-state packet contract, validation-ongoing-state revelry boundary, validation-collarino-state ledger contract, validation-ongoing-state festivity boundary, validation-apophyge-state packet contract, validation-ongoing-state conviviality boundary, validation-doucine-state ledger contract, validation-ongoing-state sociability boundary, validation-cyma-recta-state packet contract, validation-ongoing-state fellowship boundary, validation-cyma-reversa-state ledger contract, validation-ongoing-state camaraderie boundary, validation-echinus-state packet contract, validation-ongoing-state companionship boundary, validation-abacus-state ledger contract, validation-ongoing-state fraternity boundary, validation-necking-state packet contract, validation-ongoing-state solidarity boundary, validation-hypotrachelion-state ledger contract, validation-ongoing-state alliance boundary, validation-gorgerin-state packet contract, validation-ongoing-state accord boundary, validation-bolster-state ledger contract, validation-ongoing-state concord boundary, validation-taper-state packet contract, validation-ongoing-state harmony boundary, validation-shaft-state ledger contract, validation-ongoing-state unity boundary, validation-base-state packet contract, validation-ongoing-state union boundary, validation-plinth-state ledger contract, validation-ongoing-state coalition boundary, validation-pedestal-state packet contract, validation-ongoing-state partnership boundary, validation-stylobate-state ledger contract, validation-ongoing-state consortium boundary, validation-stereobate-state packet contract, validation-ongoing-state federation boundary, validation-podium-state ledger contract, validation-ongoing-state confederation boundary, validation-dais-state packet contract, validation-ongoing-state league boundary, validation-rostrum-state ledger contract, validation-ongoing-state assembly boundary, validation-tribune-state packet contract, validation-ongoing-state forum boundary, validation-lectern-state ledger contract, validation-ongoing-state council boundary, validation-pulpit-state packet contract, validation-ongoing-state caucus boundary, validation-ambo-state ledger contract, validation-ongoing-state quorum boundary, validation-minbar-state packet contract, validation-ongoing-state conclave boundary, validation-cathedra-state ledger contract, validation-ongoing-state synod boundary, validation-bema-state packet contract, validation-ongoing-state convocation boundary, validation-sedilia-state ledger contract, validation-ongoing-state chapter boundary, validation-choir-state packet contract, validation-ongoing-state vestry boundary, validation-stall-state ledger contract, validation-ongoing-state consistory boundary, validation-pew-state packet contract, validation-ongoing-state presbytery boundary, validation-nave-state ledger contract, validation-ongoing-state transept boundary, validation-aisle-state packet contract, validation-ongoing-state chancel boundary, validation-sanctuary-state ledger contract, validation-ongoing-state apse boundary, validation-altar-state packet contract, validation-ongoing-state reredos boundary, validation-retable-state ledger contract, validation-ongoing-state iconostasis boundary, validation-ciborium-state packet contract, validation-ongoing-state baldachin boundary, validation-predella-state ledger contract, validation-ongoing-state dossal boundary, validation-frontal-state packet contract, validation-ongoing-state antependium boundary, validation-superfrontal-state ledger contract, validation-ongoing-state fair-linen boundary, validation-corporal-state packet contract, validation-ongoing-state pall boundary, validation-purificator-state ledger contract, validation-ongoing-state chalice-veil boundary, validation-paten-state packet contract, validation-ongoing-state burse boundary, validation-pyx-state ledger contract, validation-ongoing-state monstrance boundary, validation-cruet-state packet contract, validation-ongoing-state lavabo boundary, validation-thurible-state ledger contract, validation-ongoing-state navicula boundary, validation-aspergillum-state packet contract, validation-ongoing-state aspersorium boundary, validation-stoup-state ledger contract, validation-ongoing-state font boundary, validation-piscina-state packet contract, validation-ongoing-state credence boundary, validation-aumbry-state ledger contract, validation-ongoing-state tabernacle boundary, validation-sacrarium-state packet contract, validation-ongoing-state conopeum boundary, validation-lunette-state ledger contract, validation-ongoing-state humeral-veil boundary, validation-custodia-state packet contract, validation-ongoing-state pyx-cloth boundary, validation-ostensorium-state ledger contract, validation-ongoing-state velum boundary, validation-lunula-state ledger contract, validation-ongoing-state cope boundary, validation-amice-state ledger contract, validation-ongoing-state stole boundary, validation-alb-state ledger contract, validation-ongoing-state chasuble boundary, validation-dalmatic-state ledger contract, validation-ongoing-state tunicle boundary, validation-maniple-state ledger contract, validation-ongoing-state fanon boundary, validation-mitre-state ledger contract, validation-ongoing-state crosier boundary, validation-pectoral-cross-state ledger contract, validation-ongoing-state ring boundary, validation-zucchetto-state ledger contract, validation-ongoing-state biretta boundary, validation-mozzetta-state ledger contract, validation-ongoing-state rochet boundary, validation-surplice-state ledger contract, validation-ongoing-state tippet boundary, validation-chimere-state ledger contract, validation-ongoing-state scarf boundary, validation-cassock-state ledger contract, validation-ongoing-state rabat boundary, validation-camauro-state ledger contract, validation-ongoing-state saturno boundary, validation-ferraiolo-state ledger contract, validation-ongoing-state mantelletta boundary, validation-cappa-magna-state ledger contract, validation-ongoing-state pellegrina boundary, validation-galero-state ledger contract, validation-ongoing-state simar boundary, validation-tabarro-state ledger contract, validation-ongoing-state gremiale boundary, validation-falda-state ledger contract, validation-ongoing-state mantum boundary, validation-sakkos-state ledger contract, validation-ongoing-state omophorion boundary, validation-epigonation-state ledger contract, validation-ongoing-state epimanikia boundary, validation-orarion-state ledger contract, validation-ongoing-state epitrachelion boundary, validation-sticharion-state ledger contract, validation-ongoing-state zonarion boundary, validation-phelonion-state ledger contract, validation-ongoing-state riassa boundary, validation-klobuk-state ledger contract, validation-ongoing-state mandyas boundary, validation-kamelavkion-state ledger contract, validation-ongoing-state epanokamelavkion boundary, validation-koukoulion-state ledger contract, validation-ongoing-state paramandyas boundary, validation-analavos-state ledger contract, validation-ongoing-state polystavrion boundary, validation-epanorion-state ledger contract, and validation-ongoing-state epirrhiptarion boundary, validation-engolpion-state ledger contract, validation-ongoing-state panagia boundary, validation-dikerion-state ledger contract, validation-ongoing-state trikerion boundary, validation-ripidion-state ledger contract, validation-ongoing-state asteriskos boundary, validation-diskos-state ledger contract, validation-ongoing-state kalymma boundary, validation-antimension-state ledger contract, validation-ongoing-state eiliton boundary, validation-aer-state ledger contract, validation-ongoing-state labis boundary, validation-diskarion-state ledger contract, validation-ongoing-state zeon boundary, validation-lonche-state ledger contract, validation-ongoing-state lance boundary, validation-lavida-state ledger contract, validation-ongoing-state sudarion boundary, validation-hexapterygon-state ledger contract, and validation-ongoing-state cherubikon boundary. This remains a runtime-evidence lane rather than a public leaderboard, cross-product telemetry platform, release-gate authority, or generic approval workflow. | +| Phase J registry condensation note | Implemented now | editorial clarification `2026-06-23` | Read the preceding validation row concisely as: HyperTwist owns an internal replay-integrity, benchmark, scorecard, regression, evidence-export, operator-review, triage, sign-off, and continuity-oriented validation substrate. It is runtime evidence infrastructure, not a public leaderboard or release-gate workflow replacement. | | Structural-only `Phase J` deprecation and behavior-first validation posture | Implemented now | landed first-party `Phase 10A` plus already-landed `Phase 10B` / `Phase 10C` | The retained structural-only `Phase J` suite is preserved only as deprecated disabled build-history ballast (`221` files / `443` deprecated identifiers / `443` disabled flags), while live validation truth stays with the behavior and integration coverage. | | Embodied companion/narration adjunct | Implemented now | landed `TalkingHead` packet | Live bounded avatar/narration family. | | Rewritten embodied companion and narrated coaching reference grounding | Implemented now | `met4citizen/TalkingHead` retained permissive lane + first-party current code | Current live `Embodied Companion and Narrated Coaching` reference side includes six rewritten first-party targets grounded in retained `TalkingHead`: queued companion narration, subtitle and viseme sync, avatar-only embed, gesture and mood cues, streaming/listening lifecycle, and TTS or asset adapter boundary posture. This does not displace the landed `Phase 3R-E` first-party embodied companion owner, any separate speech-input or queue-owner lane, or any separate voice-output provider sidecar. | @@ -263,7 +264,7 @@ repo. | Feature | Status | Primary authority | Notes | |---|---|---|---| -| Public `hypertwist.app` marketing shell | Implemented now | first-party `website/` app + feature registry/roadmap authority | HyperTwist now has a dedicated first-party public web surface for homepage, about, resources, pricing, download, support, and legal routes. This lane is separate from the embedded Unreal browser runtime under `Content/Browser/` and does not claim browser-simulator parity. The same public lane now also serves as a bounded operator/distribution manual through the docs/resources/download/support surfaces, explaining browser-versus-desktop posture, rollout steps, package proof, and simulator-use guidance without claiming browser ownership of the native runtime. The same package now also carries a first-party external runtime-readiness verifier so deploy-time env and live health posture can be checked outside the dashboard, plus separated local-versus-production env templates whose placeholder values are intentionally rejected until real launch config is in place, bootstrap CI now validates both the frontend and auth-server website commands directly, and the auth server can now auto-serve the built `website/dist` bundle with bounded SPA fallback for same-origin public deployment. Request-level server coverage now also proves that public/app shell delivery does not shadow `/api/*`, `/auth*`, `/health`, or missing asset paths, while the pricing/download/notices routes now surface first-party preview-versus-launch posture from the same bounded launch checklist instead of relying on hidden operator-only status. The shared marketing shell now also carries a compact public-site-status banner across public pages, the homepage keeps a fuller status section, and the shared public launch-status component now consumes live auth-health webhook/runtime truth in addition to release-manifest download readiness so public marketing copy does not claim launch posture from static checkout/download config alone. A later same-family continuation then widened that release-manifest authority again to carry public runtime commerce config for operator/studio checkout URLs and live plan-price strings, so pricing, notices, and dashboard launch-readiness surfaces no longer depend only on frontend build-time checkout config. The live website lane now also owns route-aware title/description/canonical/Open-Graph/Twitter metadata for the real `hypertwist.app` marketing surface so deployed public pages no longer remain on a single generic SPA title/description, plus first-party `robots.txt` and `sitemap.xml` assets for the public route set while keeping `/app`, `/login`, and `/register` out of crawler posture. The real `check-runtime-readiness` CLI is now also exercised against the checked-in production example env files, and a spawned `website/server` bootstrap proof now verifies the live same-origin process path from production-shaped env into `/health`, `/api/auth/health`, built-shell serving, and the public anonymous release-manifest posture for the shared desktop release lane. The same verifier now also probes the deployed root-shell marker and can explicitly fail when the public origin is still serving the older placeholder rollout page instead of the first-party website/auth-server lane, while the repo now also carries first-party `website/deploy/` `nginx` plus `systemd` handoff templates, a concrete same-origin public-host cutover guide, a deployment-file renderer that emits resolved operator outputs from real checkout paths, and a manifest-driven bundle renderer that lets one authoritative input own the public origin while emitting validated env plus install artifacts together, with the shared-VPS-safe default upstream moved to `3011` after live host inspection confirmed `3001` is already occupied by FamiliarOS. The same deployment lane now also distinguishes `launch` from `preview` posture so honest missing checkout/download/webhook/release values are accepted only for non-public rehearsal while placeholder strings still fail, `runtime.mode: mixed` plus `public_origin_ready: true` counts as valid preview-host proof, and the staging helper can archive either committed `HEAD` or the live worktree through `--archive-source worktree`. An isolated VPS-local staging proof then confirmed that both the committed HyperTwist website lane and the later preview-tier worktree packet can serve green health, release-manifest, and first-party shell responses on that real shared host behind `3011`, and a later root-owned cutover then replaced the public placeholder site with the live first-party same-origin preview deployment on `https://hypertwist.app`. The package now also ships a bounded root-owned live-deploy helper that stages the committed checkout, uploads the rendered bundle, installs env, rebuilds the site, replaces the live `systemd` plus `nginx` files, and validates the public origin; that helper has already been re-proved idempotently against the live host. The repo now also ships that host-proof flow as a first-party staging helper so future sessions can rerun the temp checkout/build/boot verification path directly before or after root-owned cutover. | +| Public `hypertwist.app` marketing shell | Implemented now | first-party `website/` app + feature registry/roadmap authority | HyperTwist now has a dedicated first-party public web surface for homepage, about, resources, pricing, download, support, and legal routes. This lane is separate from the embedded Unreal browser runtime under `Content/Browser/` and does not claim browser-simulator parity. The same public lane now also serves as a bounded operator/distribution manual through the docs/resources/download/support surfaces, explaining browser-versus-desktop posture, rollout steps, package proof, simulator-use guidance, and current input/device truth without claiming browser ownership of the native runtime or overclaiming unfinished VR/controller posture. The same package now also carries a first-party external runtime-readiness verifier so deploy-time env and live health posture can be checked outside the dashboard, plus separated local-versus-production env templates whose placeholder values are intentionally rejected until real launch config is in place, bootstrap CI now validates both the frontend and auth-server website commands directly, and the auth server can now auto-serve the built `website/dist` bundle with bounded SPA fallback for same-origin public deployment. Request-level server coverage now also proves that public/app shell delivery does not shadow `/api/*`, `/auth*`, `/health`, or missing asset paths, while the pricing/download/notices routes now surface first-party preview-versus-launch posture from the same bounded launch checklist instead of relying on hidden operator-only status. The shared marketing shell now also carries a compact public-site-status banner across public pages, the homepage keeps a fuller status section, and the shared public launch-status component now consumes live auth-health webhook/runtime truth in addition to release-manifest download readiness so public marketing copy does not claim launch posture from static checkout/download config alone. A later same-family continuation then widened that release-manifest authority again to carry public runtime commerce config for operator/studio checkout URLs and live plan-price strings, so pricing, notices, and dashboard launch-readiness surfaces no longer depend only on frontend build-time checkout config. The live website lane now also owns route-aware title/description/canonical/Open-Graph/Twitter metadata for the real `hypertwist.app` marketing surface so deployed public pages no longer remain on a single generic SPA title/description, plus first-party `robots.txt` and `sitemap.xml` assets for the public route set while keeping `/app`, `/login`, and `/register` out of crawler posture. The real `check-runtime-readiness` CLI is now also exercised against the checked-in production example env files, and a spawned `website/server` bootstrap proof now verifies the live same-origin process path from production-shaped env into `/health`, `/api/auth/health`, built-shell serving, and the public anonymous release-manifest posture for the shared desktop release lane. The same verifier now also probes the deployed root-shell marker and can explicitly fail when the public origin is still serving the older placeholder rollout page instead of the first-party website/auth-server lane, while the repo now also carries first-party `website/deploy/` `nginx` plus `systemd` handoff templates, a concrete same-origin public-host cutover guide, a deployment-file renderer that emits resolved operator outputs from real checkout paths, and a manifest-driven bundle renderer that lets one authoritative input own the public origin while emitting validated env plus install artifacts together, with the shared-VPS-safe default upstream moved to `3011` after live host inspection confirmed `3001` is already occupied by FamiliarOS. The same deployment lane now also distinguishes `launch` from `preview` posture so honest missing checkout/download/webhook/release values are accepted only for non-public rehearsal while placeholder strings still fail, `runtime.mode: mixed` plus `public_origin_ready: true` counts as valid preview-host proof, and the staging helper can archive either committed `HEAD` or the live worktree through `--archive-source worktree`. An isolated VPS-local staging proof then confirmed that both the committed HyperTwist website lane and the later preview-tier worktree packet can serve green health, release-manifest, and first-party shell responses on that real shared host behind `3011`, and a later root-owned cutover then replaced the public placeholder site with the live first-party same-origin preview deployment on `https://hypertwist.app`. The package now also ships a bounded root-owned live-deploy helper that stages the committed checkout, uploads the rendered bundle, installs env, rebuilds the site, replaces the live `systemd` plus `nginx` files, and validates the public origin; that helper has already been re-proved idempotently against the live host. The repo now also ships that host-proof flow as a first-party staging helper so future sessions can rerun the temp checkout/build/boot verification path directly before or after root-owned cutover. | | Browser-based operator/account dashboard | Implemented now | first-party `website/` app + shared auth/dashboard packet | A protected browser dashboard is now live for operator access, account state, download posture, browser-access boundary explanation, notices review, and bounded billing/entitlement status. It reuses the shared SuperTokens auth posture proven in FamiliarOS and ScriptoriumAI while remaining HyperTwist-specific in product content and boundary claims, the current auth-health surface now truthfully distinguishes configured versus reachable or ready shared-core posture while exposing fallback-active reason instead of hardcoding readiness, and the same dashboard now also surfaces launch-readiness truth for download URLs, checkout links, source/notices URLs, billing-secret/map configuration, and local-versus-public runtime deployment posture. The same protected overview now also consumes the server-backed Windows packaged-validation summary that the release-manifest authority exposes, so operators can see current higher-dimensional desktop proof without drilling into the dedicated downloads screen. Focused frontend coverage now also protects deep-link login redirect preservation, safe `next`-path normalization across auth entry points, fallback/email auth-bootstrap normalization, login/register continuation behavior, public download-gating behavior, protected-route/shell behavior, real lazy-route tree behavior for key public and protected paths, top-level app-bootstrap and SuperTokens-wrapper posture, login/register unhappy-path and OAuth-button behavior, support-topic fallback routing when live checkout is not configured, desktop-link verify-url/dashboard readiness behavior, and explicit `noindex,nofollow` posture on protected/auth browser surfaces. The validation lane now also has a bounded signed test-session harness under `TEST_MODE=testing` that proves `/api/auth/me` and `/api/auth/desktop-link` behavior through the live spawned auth-server process without widening production auth posture. | | Desktop download posture and browser-to-desktop pairing | Implemented now | first-party `website/` app + `website/server` desktop-link endpoints | Public download targets, dashboard-side release posture, and short-lived desktop-link token generation/verification are now first-party owned. The current server posture now enforces exact website-origin matching, bounded per-user issuance, one-time token consumption, and billing-backed plan/download entitlement resolution with focused `website/server` tests green on `2026-06-22`, and the verify handshake now returns the same resolved download-entitlement posture the dashboard sees instead of only identity plus plan/role. The same lane now also owns a shared `GET /api/releases/manifest` runtime authority for release version/channel/build/published/file-size/checksum/docs/source metadata, with anonymous callers intentionally denied raw download URLs while entitled session-backed callers receive the configured direct platform URL. That manifest now also carries first-party packaged-validation summary truth for the Windows higher-dimensional desktop lane, so the public `/download` page, the public `/resources` reference page, and the protected `/app/downloads` surface can project real package evidence for the dedicated-family `Magic120Cell` / `MagicCube5D` maps even while launch-tier release URLs remain unconfigured. The public `/download` page now keeps raw download URLs behind the protected dashboard instead of exposing them directly, preserves requested platform continuity through `/app/downloads?platform=...`, and surfaces that requested target again after auth handoff inside the protected release lane. Both the public and protected download surfaces now also carry first-party rollout steps plus release/notices/source references so the desktop setup lane is more than a generic link bucket, and the dashboard plus public launch-status callouts now consume the same manifest-backed Windows download truth instead of only static frontend config. Actual release URLs remain deployment configuration rather than hardcoded product truth. | | Paddle-ready pricing and billing webhook seam | Implemented now | first-party `website/` app + `website/server` billing endpoint | The public pricing surface now exists with plan structure, checkout-link configuration seams, and the same `/api/billing/paddle/webhook` endpoint family used by the broader product website lane. The current server now verifies `Paddle-Signature` against `PADDLE_WEBHOOK_SECRET` using the documented raw-body HMAC flow, persists a bounded first-party billing state file, and applies verified Paddle events into account/download entitlement state that the browser dashboard consumes, with focused `website/server` tests green on `2026-06-22`. The shared `GET /api/releases/manifest` authority now also carries public runtime commerce config for operator/studio checkout URLs and live plan-price strings, allowing the pricing page to switch from frontend build-time checkout assumptions to auth-server runtime truth when those values are configured. A spawned live-process proof now also verifies that a real signed webhook updates processed-event health and persisted billing state through the actual auth-server runtime, not only helper-level store tests, and transaction events no longer leak their id into stored `subscriptionId` state. Production checkout URLs, secret management, and broader operator/admin billing workflows remain deployment/application tasks, not shipped-code omissions. | diff --git a/scripts/bootstrap-hypertwist-sentrux.sh b/scripts/bootstrap-hypertwist-sentrux.sh new file mode 100644 index 0000000..97d72fa --- /dev/null +++ b/scripts/bootstrap-hypertwist-sentrux.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +dest_dir="$repo_root/tools/sentrux/bin" +dest_linux="$dest_dir/sentrux" +dest_windows="$dest_dir/sentrux.exe" + +vector_sentrux_binary="/home/dev/src/VectorShell/sentrux/target/release/sentrux" +vector_sentrux_manifest="/home/dev/src/VectorShell/sentrux/Cargo.toml" +scriptorium_sentrux_windows="/home/dev/src/ScriptoriumAI/sentrux.exe" + +usage() { + cat <<'EOF' +Usage: + scripts/bootstrap-hypertwist-sentrux.sh [--if-missing] + +Materializes a repo-local sentrux binary under tools/sentrux/bin/ using the +best available retained source on this machine. + +Resolution order: + 1. existing VectorShell Linux build artifact + 2. local VectorShell source build via cargo + 3. local ScriptoriumAI Windows binary +EOF +} + +copy_binary() { + local source_path="$1" + local destination_path="$2" + + mkdir -p "$dest_dir" + cp "$source_path" "$destination_path" + chmod +x "$destination_path" 2>/dev/null || true + printf 'Materialized sentrux at %s from %s\n' "$destination_path" "$source_path" +} + +if [[ "${1:-}" == "--help" ]]; then + usage + exit 0 +fi + +if [[ "${1:-}" == "--if-missing" ]]; then + if [[ -x "$dest_linux" || -x "$dest_windows" ]]; then + printf 'Repo-local sentrux already present under %s\n' "$dest_dir" + exit 0 + fi +elif [[ $# -gt 0 ]]; then + usage >&2 + exit 1 +fi + +if [[ -x "$vector_sentrux_binary" ]]; then + copy_binary "$vector_sentrux_binary" "$dest_linux" + exit 0 +fi + +if command -v cargo >/dev/null 2>&1 && [[ -f "$vector_sentrux_manifest" ]]; then + cargo build --quiet --release --manifest-path "$vector_sentrux_manifest" --bin sentrux + if [[ -x "$vector_sentrux_binary" ]]; then + copy_binary "$vector_sentrux_binary" "$dest_linux" + exit 0 + fi +fi + +if [[ -f "$scriptorium_sentrux_windows" ]]; then + copy_binary "$scriptorium_sentrux_windows" "$dest_windows" + exit 0 +fi + +cat >&2 < + Required. May be repeated. Filters are run sequentially in the order given. + + --report-prefix + Optional prefix for per-filter report names. + + --extra-arg + Append an extra UnrealEditor-Cmd.exe argument to every filter run. + + --dry-run + Print the underlying wrapper invocations instead of executing them. +EOF +} + +filters=() +report_prefix="" +dry_run="false" +extra_args=() + +while [[ $# -gt 0 ]]; do + case "$1" in + --filter) + filters+=("${2:-}") + shift 2 + ;; + --report-prefix) + report_prefix="${2:-}" + shift 2 + ;; + --extra-arg) + extra_args+=("${2:-}") + shift 2 + ;; + --dry-run) + dry_run="true" + shift + ;; + -h|--help) + usage + exit 0 + ;; + *) + usage >&2 + exit 1 + ;; + esac +done + +if [[ ${#filters[@]} -eq 0 ]]; then + echo "Provide at least one --filter." >&2 + exit 1 +fi + +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +single_wrapper="${script_dir}/run-hypertwist-remote-unreal-automation.sh" + +if [[ ! -x "$single_wrapper" ]]; then + echo "Expected executable wrapper at $single_wrapper" >&2 + exit 1 +fi + +sanitize_report_name() { + printf '%s' "$1" | sed 's/[^[:alnum:]._+-]/_/g' +} + +for filter in "${filters[@]}"; do + report_name="$(sanitize_report_name "$filter")" + if [[ -n "$report_prefix" ]]; then + report_name="${report_prefix}-$(sanitize_report_name "$filter")" + fi + + command=( + "$single_wrapper" + --filter "$filter" + --report-name "$report_name" + ) + + for extra_arg in "${extra_args[@]}"; do + command+=(--extra-arg "$extra_arg") + done + + if [[ "$dry_run" == "true" ]]; then + printf '%q ' "${command[@]}" + printf '\n' + continue + fi + + echo "Running remote Unreal automation filter: $filter" + "${command[@]}" +done diff --git a/scripts/run-hypertwist-remote-unreal-automation.sh b/scripts/run-hypertwist-remote-unreal-automation.sh new file mode 100644 index 0000000..662ec49 --- /dev/null +++ b/scripts/run-hypertwist-remote-unreal-automation.sh @@ -0,0 +1,161 @@ +#!/usr/bin/env bash +set -euo pipefail + +usage() { + cat <<'EOF' +Usage: + HYPERTWIST_REMOTE_WINDOWS_PASSWORD=... \ + scripts/run-hypertwist-remote-unreal-automation.sh --filter HyperTwist.FirstParty.Skill + +Options: + --filter + Required Unreal automation filter. + + --report-name + Optional report/log folder suffix. Defaults to a sanitized filter name. + + --extra-arg + Append an extra UnrealEditor-Cmd.exe argument. May be repeated. + + --dry-run + Print the generated remote PowerShell payload instead of executing it. + +Environment: + HYPERTWIST_REMOTE_WINDOWS_PASSWORD Required by the underlying tunnel wrapper. + HYPERTWIST_REMOTE_WINDOWS_WORKTREE_ROOT Optional, defaults to C:\HyperTwist_worktrees\phase10validate + HYPERTWIST_REMOTE_WINDOWS_PROJECT_PATH Optional, defaults beneath the worktree root. + HYPERTWIST_REMOTE_WINDOWS_UNREAL_EDITOR_CMD + Optional, defaults to the UE 5.7 UnrealEditor-Cmd.exe path. + HYPERTWIST_REMOTE_WINDOWS_AUTOMATION_REPORT_ROOT + Optional, defaults beneath Saved\AutomationReports. + HYPERTWIST_REMOTE_WINDOWS_LOG_ROOT Optional, defaults beneath Saved\Logs. +EOF +} + +filter="" +report_name="" +dry_run="false" +extra_args=() + +while [[ $# -gt 0 ]]; do + case "$1" in + --filter) + filter="${2:-}" + shift 2 + ;; + --report-name) + report_name="${2:-}" + shift 2 + ;; + --extra-arg) + extra_args+=("${2:-}") + shift 2 + ;; + --dry-run) + dry_run="true" + shift + ;; + -h|--help) + usage + exit 0 + ;; + *) + usage >&2 + exit 1 + ;; + esac +done + +if [[ -z "$filter" ]]; then + echo "Provide --filter." >&2 + exit 1 +fi + +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +remote_ps_wrapper="${script_dir}/run-hypertwist-remote-windows-powershell.sh" + +if [[ ! -x "$remote_ps_wrapper" ]]; then + echo "Expected executable wrapper at $remote_ps_wrapper" >&2 + exit 1 +fi + +worktree_root="${HYPERTWIST_REMOTE_WINDOWS_WORKTREE_ROOT:-C:\\HyperTwist_worktrees\\phase10validate}" +project_path="${HYPERTWIST_REMOTE_WINDOWS_PROJECT_PATH:-${worktree_root}\\UnrealHyperTwist\\UnrealHyperTwist.uproject}" +editor_cmd_path="${HYPERTWIST_REMOTE_WINDOWS_UNREAL_EDITOR_CMD:-C:\\Program Files\\Epic Games\\UE_5.7\\Engine\\Binaries\\Win64\\UnrealEditor-Cmd.exe}" +report_root="${HYPERTWIST_REMOTE_WINDOWS_AUTOMATION_REPORT_ROOT:-${worktree_root}\\UnrealHyperTwist\\Saved\\AutomationReports}" +log_root="${HYPERTWIST_REMOTE_WINDOWS_LOG_ROOT:-${worktree_root}\\UnrealHyperTwist\\Saved\\Logs}" + +if [[ -z "$report_name" ]]; then + report_name="$(printf '%s' "$filter" | sed 's/[^[:alnum:]._+-]/_/g')" +fi + +report_export_path="${report_root}\\${report_name}" +abs_log_path="${log_root}\\${report_name}.log" + +powershell_payload="$( + python3 - <<'PY' \ + "$editor_cmd_path" \ + "$project_path" \ + "$report_export_path" \ + "$abs_log_path" \ + "$filter" \ + "${extra_args[@]}" +import sys + +editor_cmd_path, project_path, report_export_path, abs_log_path, filter_name, *extra_args = sys.argv[1:] + +def ps_single_quote(value: str) -> str: + return "'" + value.replace("'", "''") + "'" + +lines = [ + f"$EditorCmdPath = {ps_single_quote(editor_cmd_path)}", + f"$ProjectPath = {ps_single_quote(project_path)}", + f"$ReportExportPath = {ps_single_quote(report_export_path)}", + f"$AbsLogPath = {ps_single_quote(abs_log_path)}", + f"$Filter = {ps_single_quote(filter_name)}", + "", + "New-Item -ItemType Directory -Force -Path $ReportExportPath | Out-Null", + "New-Item -ItemType Directory -Force -Path (Split-Path -Parent $AbsLogPath) | Out-Null", + "", + "if (-not (Test-Path -LiteralPath $EditorCmdPath)) {", + " throw \"UnrealEditor-Cmd.exe was not found at '$EditorCmdPath'.\"", + "}", + "", + "if (-not (Test-Path -LiteralPath $ProjectPath)) {", + " throw \"Project file was not found at '$ProjectPath'.\"", + "}", + "", + "& $EditorCmdPath `", + " $ProjectPath `", + " -unattended `", + " -nop4 `", + " -nosplash `", + " -NullRHI `", + " -log `", + " -stdout `", + " -FullStdOutLogOutput `", + " \"-AbsLog=$AbsLogPath\" `", + " \"-ReportExportPath=$ReportExportPath\" `", + " \"-ExecCmds=Automation RunTests $Filter\" `", +] + +if extra_args: + for extra_arg in extra_args: + lines.append(f" {ps_single_quote(extra_arg)} `") + +lines.extend([ + " \"-TestExit=Automation Test Queue Empty\"", + "", + "exit $LASTEXITCODE", +]) + +print("\n".join(lines)) +PY +)" + +if [[ "$dry_run" == "true" ]]; then + printf '%s\n' "$powershell_payload" + exit 0 +fi + +exec "$remote_ps_wrapper" --command "$powershell_payload" diff --git a/scripts/run-hypertwist-remote-unreal-build.sh b/scripts/run-hypertwist-remote-unreal-build.sh new file mode 100644 index 0000000..0af415c --- /dev/null +++ b/scripts/run-hypertwist-remote-unreal-build.sh @@ -0,0 +1,213 @@ +#!/usr/bin/env bash +set -euo pipefail + +usage() { + cat <<'EOF' +Usage: + HYPERTWIST_REMOTE_WINDOWS_PASSWORD=... \ + scripts/run-hypertwist-remote-unreal-build.sh + +Options: + --target + Optional Unreal build target. Defaults to UnrealHyperTwistEditor. + + --platform + Optional Unreal platform. Defaults to Win64. + + --configuration + Optional Unreal configuration. Defaults to Development. + + --worktree-root + Optional Windows worktree root. Defaults to C:\HyperTwist_worktrees\phase10validate. + + --project-path + Optional Windows .uproject path. Defaults beneath the worktree root. + + --build-batch-path + Optional Build.bat path. Defaults to the UE 5.7 installed-engine path. + + --max-parallel-actions + Optional MaxParallelActions override. Defaults to 2 for the remote lane. + + --allow-uba + Allow UBA instead of forcing the verified remote-lane -NoUBA posture. + + --extra-arg + Append an extra Build.bat argument. May be repeated. + + --dry-run + Print the generated remote PowerShell payload instead of executing it. + +Environment: + HYPERTWIST_REMOTE_WINDOWS_PASSWORD Required by the underlying tunnel wrapper. + HYPERTWIST_REMOTE_WINDOWS_WORKTREE_ROOT Optional default for --worktree-root. + HYPERTWIST_REMOTE_WINDOWS_PROJECT_PATH Optional default for --project-path. + HYPERTWIST_REMOTE_WINDOWS_BUILD_BAT Optional default for --build-batch-path. + HYPERTWIST_REMOTE_WINDOWS_MAX_PARALLEL_ACTIONS + Optional default for --max-parallel-actions. +EOF +} + +target_name="UnrealHyperTwistEditor" +platform_name="Win64" +configuration_name="Development" +worktree_root="${HYPERTWIST_REMOTE_WINDOWS_WORKTREE_ROOT:-C:\\HyperTwist_worktrees\\phase10validate}" +project_path="" +build_batch_path="${HYPERTWIST_REMOTE_WINDOWS_BUILD_BAT:-C:\\Program Files\\Epic Games\\UE_5.7\\Engine\\Build\\BatchFiles\\Build.bat}" +max_parallel_actions="${HYPERTWIST_REMOTE_WINDOWS_MAX_PARALLEL_ACTIONS:-2}" +allow_uba="false" +dry_run="false" +extra_args=() + +while [[ $# -gt 0 ]]; do + case "$1" in + --target) + target_name="${2:-}" + shift 2 + ;; + --platform) + platform_name="${2:-}" + shift 2 + ;; + --configuration) + configuration_name="${2:-}" + shift 2 + ;; + --worktree-root) + worktree_root="${2:-}" + shift 2 + ;; + --project-path) + project_path="${2:-}" + shift 2 + ;; + --build-batch-path) + build_batch_path="${2:-}" + shift 2 + ;; + --max-parallel-actions) + max_parallel_actions="${2:-}" + shift 2 + ;; + --allow-uba) + allow_uba="true" + shift + ;; + --extra-arg) + extra_args+=("${2:-}") + shift 2 + ;; + --dry-run) + dry_run="true" + shift + ;; + -h|--help) + usage + exit 0 + ;; + *) + usage >&2 + exit 1 + ;; + esac +done + +if [[ -z "$project_path" ]]; then + project_path="${HYPERTWIST_REMOTE_WINDOWS_PROJECT_PATH:-${worktree_root}\\UnrealHyperTwist\\UnrealHyperTwist.uproject}" +fi + +if [[ -z "$target_name" || -z "$platform_name" || -z "$configuration_name" || -z "$project_path" || -z "$build_batch_path" ]]; then + echo "Target, platform, configuration, project path, and Build.bat path must all be populated." >&2 + exit 1 +fi + +if [[ -n "$max_parallel_actions" && ! "$max_parallel_actions" =~ ^[0-9]+$ ]]; then + echo "--max-parallel-actions must be numeric." >&2 + exit 1 +fi + +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +remote_ps_wrapper="${script_dir}/run-hypertwist-remote-windows-powershell.sh" + +if [[ ! -x "$remote_ps_wrapper" ]]; then + echo "Expected executable wrapper at $remote_ps_wrapper" >&2 + exit 1 +fi + +powershell_payload="$( + python3 - <<'PY' \ + "$build_batch_path" \ + "$target_name" \ + "$platform_name" \ + "$configuration_name" \ + "$project_path" \ + "$max_parallel_actions" \ + "$allow_uba" \ + "${extra_args[@]}" +import sys + +build_batch_path, target_name, platform_name, configuration_name, project_path, max_parallel_actions, allow_uba, *extra_args = sys.argv[1:] + +def ps_single_quote(value: str) -> str: + return "'" + value.replace("'", "''") + "'" + +lines = [ + f"$BuildBatchPath = {ps_single_quote(build_batch_path)}", + f"$TargetName = {ps_single_quote(target_name)}", + f"$PlatformName = {ps_single_quote(platform_name)}", + f"$ConfigurationName = {ps_single_quote(configuration_name)}", + f"$ProjectPath = {ps_single_quote(project_path)}", + f"$MaxParallelActions = {max_parallel_actions}", + f"$AllowUba = ${'true' if allow_uba == 'true' else 'false'}", + "$ExtraArgs = @(", +] + +for value in extra_args: + lines.append(f" {ps_single_quote(value)}") + +lines.extend([ + ")", + "", + "if (-not (Test-Path -LiteralPath $BuildBatchPath)) {", + " throw \"Build.bat was not found at '$BuildBatchPath'.\"", + "}", + "", + "if (-not (Test-Path -LiteralPath $ProjectPath)) {", + " throw \"Project file was not found at '$ProjectPath'.\"", + "}", + "", + "$BuildArgs = @(", + " $TargetName", + " $PlatformName", + " $ConfigurationName", + " $ProjectPath", + " '-WaitMutex'", + " '-NoHotReloadFromIDE'", + ")", + "", + "if (-not $AllowUba) {", + " $BuildArgs += '-NoUBA'", + "}", + "", + "if ($MaxParallelActions -gt 0) {", + " $BuildArgs += \"-MaxParallelActions=$MaxParallelActions\"", + "}", + "", + "if ($ExtraArgs.Count -gt 0) {", + " $BuildArgs += $ExtraArgs", + "}", + "", + "& $BuildBatchPath @BuildArgs", + "exit $LASTEXITCODE", +]) + +print("\n".join(lines)) +PY +)" + +if [[ "$dry_run" == "true" ]]; then + printf '%s\n' "$powershell_payload" + exit 0 +fi + +exec "$remote_ps_wrapper" --command "$powershell_payload" diff --git a/scripts/run-hypertwist-remote-windows-file-sync.sh b/scripts/run-hypertwist-remote-windows-file-sync.sh new file mode 100644 index 0000000..4f13c7c --- /dev/null +++ b/scripts/run-hypertwist-remote-windows-file-sync.sh @@ -0,0 +1,142 @@ +#!/usr/bin/env bash +set -euo pipefail + +usage() { + cat <<'EOF' +Usage: + HYPERTWIST_REMOTE_WINDOWS_PASSWORD=... \ + scripts/run-hypertwist-remote-windows-file-sync.sh \ + --file UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistBootstrap/HyperTwistContractLibrary.cpp + +Options: + --file + Relative repo path to copy into the remote Windows worktree. May be repeated. + + --remote-root + Optional Windows worktree root. Defaults to C:\HyperTwist_worktrees\phase10validate. + + --dry-run + Print the copy plan without transferring files. + +Environment: + HYPERTWIST_REMOTE_WINDOWS_PASSWORD Required password for the reverse-SSH Windows user. + HYPERTWIST_REMOTE_TUNNEL_PORT Optional, defaults to 22022. + HYPERTWIST_REMOTE_WINDOWS_USER Optional, defaults to "anthracite ace". + HYPERTWIST_REMOTE_TUNNEL_HOST Optional, defaults to "localhost". +EOF +} + +if ! command -v sshpass >/dev/null 2>&1; then + echo "sshpass is required but was not found on PATH." >&2 + exit 1 +fi + +if ! command -v sha256sum >/dev/null 2>&1; then + echo "sha256sum is required but was not found on PATH." >&2 + exit 1 +fi + +if [[ -z "${HYPERTWIST_REMOTE_WINDOWS_PASSWORD:-}" ]]; then + echo "Set HYPERTWIST_REMOTE_WINDOWS_PASSWORD before using this wrapper." >&2 + exit 1 +fi + +remote_root='C:\HyperTwist_worktrees\phase10validate' +chunk_size_bytes=65536 +dry_run="false" +files=() + +while [[ $# -gt 0 ]]; do + case "$1" in + --file) + files+=("${2:-}") + shift 2 + ;; + --remote-root) + remote_root="${2:-}" + shift 2 + ;; + --dry-run) + dry_run="true" + shift + ;; + -h|--help) + usage + exit 0 + ;; + *) + usage >&2 + exit 1 + ;; + esac +done + +if [[ ${#files[@]} -eq 0 ]]; then + echo "Provide at least one --file." >&2 + exit 1 +fi + +remote_port="${HYPERTWIST_REMOTE_TUNNEL_PORT:-22022}" +remote_user="${HYPERTWIST_REMOTE_WINDOWS_USER:-anthracite ace}" +remote_host="${HYPERTWIST_REMOTE_TUNNEL_HOST:-localhost}" + +for relative_path in "${files[@]}"; do + if [[ "$relative_path" = /* ]]; then + echo "Use repo-relative paths only: $relative_path" >&2 + exit 1 + fi + + if [[ ! -f "$relative_path" ]]; then + echo "File not found: $relative_path" >&2 + exit 1 + fi + + windows_relative_path="${relative_path//\//\\}" + windows_dest_path="${remote_root}\\${windows_relative_path}" + local_hash="$(sha256sum "$relative_path" | awk '{print tolower($1)}')" + + if [[ "$dry_run" == "true" ]]; then + printf '%s -> %s (%s)\n' "$relative_path" "$windows_dest_path" "$local_hash" + continue + fi + + ssh_base=( + sshpass -p "${HYPERTWIST_REMOTE_WINDOWS_PASSWORD}" + ssh + -o StrictHostKeyChecking=no + -o PreferredAuthentications=password + -o PubkeyAuthentication=no + -p "${remote_port}" + -l "${remote_user}" + "${remote_host}" + ) + + "${ssh_base[@]}" \ + "powershell -NoProfile -Command \"\$dest='${windows_dest_path}'; \$destDir = Split-Path -Parent \$dest; New-Item -ItemType Directory -Force -Path \$destDir | Out-Null; \$outputStream = [IO.File]::Open(\$dest, [IO.FileMode]::Create, [IO.FileAccess]::Write, [IO.FileShare]::None); \$outputStream.Dispose()\"" + + tmp_chunk_dir="$(mktemp -d)" + split -b "${chunk_size_bytes}" --numeric-suffixes=1 --suffix-length=4 \ + "$relative_path" "${tmp_chunk_dir}/chunk-" + + for chunk_path in "${tmp_chunk_dir}"/chunk-*; do + cat "$chunk_path" | \ + "${ssh_base[@]}" \ + "powershell -NoProfile -Command \"\$dest='${windows_dest_path}'; \$outputStream = [IO.File]::Open(\$dest, [IO.FileMode]::Append, [IO.FileAccess]::Write, [IO.FileShare]::None); try { [Console]::OpenStandardInput().CopyTo(\$outputStream) } finally { \$outputStream.Dispose() }\"" + done + + remote_hash="$( + "${ssh_base[@]}" \ + "powershell -NoProfile -Command \"[Console]::Out.Write((Get-FileHash -LiteralPath '${windows_dest_path}' -Algorithm SHA256).Hash.ToLowerInvariant())\"" + )" + + rm -rf "$tmp_chunk_dir" + + if [[ "$remote_hash" != "$local_hash" ]]; then + echo "Hash mismatch for $relative_path" >&2 + echo " local : $local_hash" >&2 + echo " remote: $remote_hash" >&2 + exit 1 + fi + + printf 'Synced %s -> %s (%s)\n' "$relative_path" "$windows_dest_path" "$local_hash" +done diff --git a/scripts/run-hypertwist-remote-windows-powershell.sh b/scripts/run-hypertwist-remote-windows-powershell.sh new file mode 100644 index 0000000..0b6ebe9 --- /dev/null +++ b/scripts/run-hypertwist-remote-windows-powershell.sh @@ -0,0 +1,90 @@ +#!/usr/bin/env bash +set -euo pipefail + +usage() { + cat <<'EOF' +Usage: + HYPERTWIST_REMOTE_WINDOWS_PASSWORD=... \ + scripts/run-hypertwist-remote-windows-powershell.sh --command "Write-Output 'hello'" + + HYPERTWIST_REMOTE_WINDOWS_PASSWORD=... \ + scripts/run-hypertwist-remote-windows-powershell.sh --script-file ./script.ps1 + +Options: + --command + Run the provided PowerShell source text. + + --script-file + Read PowerShell source from the given file. + +Environment: + HYPERTWIST_REMOTE_WINDOWS_PASSWORD Required password for the reverse-SSH Windows user. + HYPERTWIST_REMOTE_TUNNEL_PORT Optional, defaults to 22022. + HYPERTWIST_REMOTE_WINDOWS_USER Optional, defaults to "anthracite ace". + HYPERTWIST_REMOTE_TUNNEL_HOST Optional, defaults to "localhost". +EOF +} + +if [[ $# -lt 2 ]]; then + usage >&2 + exit 1 +fi + +if ! command -v sshpass >/dev/null 2>&1; then + echo "sshpass is required but was not found on PATH." >&2 + exit 1 +fi + +if [[ -z "${HYPERTWIST_REMOTE_WINDOWS_PASSWORD:-}" ]]; then + echo "Set HYPERTWIST_REMOTE_WINDOWS_PASSWORD before using this wrapper." >&2 + exit 1 +fi + +script_text="" + +case "$1" in + --command) + script_text="$2" + ;; + --script-file) + if [[ ! -f "$2" ]]; then + echo "Script file not found: $2" >&2 + exit 1 + fi + script_text="$(<"$2")" + ;; + -h|--help) + usage + exit 0 + ;; + *) + usage >&2 + exit 1 + ;; +esac + +remote_port="${HYPERTWIST_REMOTE_TUNNEL_PORT:-22022}" +remote_user="${HYPERTWIST_REMOTE_WINDOWS_USER:-anthracite ace}" +remote_host="${HYPERTWIST_REMOTE_TUNNEL_HOST:-localhost}" +script_preamble=$'$ProgressPreference = \'SilentlyContinue\'\n$ErrorActionPreference = \'Stop\'\n' +script_payload="${script_preamble}${script_text}" + +encoded_command="$( + python3 - <<'PY' "$script_payload" +import base64 +import sys + +script = sys.argv[1] +print(base64.b64encode(script.encode("utf-16le")).decode("ascii")) +PY +)" + +exec sshpass -p "${HYPERTWIST_REMOTE_WINDOWS_PASSWORD}" \ + ssh \ + -o StrictHostKeyChecking=no \ + -o PreferredAuthentications=password \ + -o PubkeyAuthentication=no \ + -p "${remote_port}" \ + -l "${remote_user}" \ + "${remote_host}" \ + "powershell -NoProfile -EncodedCommand ${encoded_command}" diff --git a/scripts/run-hypertwist-sentrux-source-only.sh b/scripts/run-hypertwist-sentrux-source-only.sh index 9b3950c..95116cf 100644 --- a/scripts/run-hypertwist-sentrux-source-only.sh +++ b/scripts/run-hypertwist-sentrux-source-only.sh @@ -5,6 +5,8 @@ repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" temp_root="${TMPDIR:-/tmp}/hypertwist-sentrux-source-only" repo_local_sentrux_binary="$repo_root/sentrux" repo_local_sentrux_windows_binary="$repo_root/sentrux.exe" +repo_tools_sentrux_binary="$repo_root/tools/sentrux/bin/sentrux" +repo_tools_sentrux_windows_binary="$repo_root/tools/sentrux/bin/sentrux.exe" local_sentrux_binary="/home/dev/src/VectorShell/sentrux/target/release/sentrux" local_sentrux_manifest="/home/dev/src/VectorShell/sentrux/Cargo.toml" @@ -24,6 +26,16 @@ resolve_sentrux_command() { return 0 fi + if [[ -x "$repo_tools_sentrux_binary" ]]; then + printf '%s\n' "$repo_tools_sentrux_binary" + return 0 + fi + + if [[ -x "$repo_tools_sentrux_windows_binary" ]]; then + printf '%s\n' "$repo_tools_sentrux_windows_binary" + return 0 + fi + if command -v sentrux >/dev/null 2>&1; then printf 'sentrux\n' return 0 @@ -43,7 +55,7 @@ resolve_sentrux_command() { } sentrux_command="$(resolve_sentrux_command)" || { - echo "Unable to locate sentrux. Provide HYPERTWIST_SENTRUX_BINARY, add sentrux to PATH, place a repo-local sentrux binary at $repo_root, or keep /home/dev/src/VectorShell/sentrux available." >&2 + echo "Unable to locate sentrux. Provide HYPERTWIST_SENTRUX_BINARY, run scripts/bootstrap-hypertwist-sentrux.sh, add sentrux to PATH, place a repo-local sentrux binary at $repo_root, or keep /home/dev/src/VectorShell/sentrux available." >&2 exit 1 } diff --git a/tools/sentrux/README.md b/tools/sentrux/README.md new file mode 100644 index 0000000..fec47ea --- /dev/null +++ b/tools/sentrux/README.md @@ -0,0 +1,15 @@ +# HyperTwist-local sentrux landing zone + +This directory is the HyperTwist-owned location for a repo-local `sentrux` +binary. + +Do not commit platform binaries here. + +Use: + +```bash +scripts/bootstrap-hypertwist-sentrux.sh +``` + +That helper materializes a local binary under `tools/sentrux/bin/` from the +best retained source available on this machine. diff --git a/tools/sentrux/bin/.gitkeep b/tools/sentrux/bin/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tools/sentrux/bin/.gitkeep @@ -0,0 +1 @@ + diff --git a/website/src/__tests__/protected-app-pages.test.tsx b/website/src/__tests__/protected-app-pages.test.tsx index aeee875..c7c3298 100644 --- a/website/src/__tests__/protected-app-pages.test.tsx +++ b/website/src/__tests__/protected-app-pages.test.tsx @@ -2,6 +2,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import { cleanup, render, screen } from '@testing-library/react' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { MemoryRouter } from 'react-router-dom' +import { ROUTER_FUTURE_FLAGS } from '../router/router-future' const mockUsePlatformAuth = vi.fn() const mockGetAuthHealth = vi.fn() @@ -31,7 +32,7 @@ function renderPage(page: React.ReactNode, initialEntry: string) { return render( - + {page} , diff --git a/website/src/__tests__/public-marketing-pages.test.tsx b/website/src/__tests__/public-marketing-pages.test.tsx index 2ce0c02..b0af0ca 100644 --- a/website/src/__tests__/public-marketing-pages.test.tsx +++ b/website/src/__tests__/public-marketing-pages.test.tsx @@ -547,6 +547,8 @@ describe('public marketing pages', () => { expect(screen.getByText('Selected help lane')).toBeTruthy() expect(screen.getByText('Launch readiness')).toBeTruthy() expect(screen.getByText(/turning the preview lane into a public launch/i)).toBeTruthy() + expect(screen.getByText('If the desktop app is primary, why keep the web version?')).toBeTruthy() + expect(screen.getByText('Is VR/controller support already fully finished?')).toBeTruthy() expect(screen.getByText('Support lanes')).toBeTruthy() }) @@ -650,6 +652,10 @@ describe('public marketing pages', () => { expect(screen.getAllByText(/MagicCube5D dedicated-family training map: passed/i).length).toBeGreaterThan(0) expect(screen.getByText('Operator playbooks')).toBeTruthy() expect(screen.getByText('Simulator use today')).toBeTruthy() + expect(screen.getByText('Higher-dimensional runtime guide')).toBeTruthy() + expect(screen.getByText('Current control and device posture')).toBeTruthy() + expect(screen.getByText('Deployment readiness snapshot')).toBeTruthy() + expect(screen.getByText('XR groundwork exists, but the full VR lane is not finished')).toBeTruthy() expect(screen.getByText('Higher-dimensional runtime ownership')).toBeTruthy() }) @@ -715,6 +721,10 @@ describe('public marketing pages', () => { expect(screen.getByText('Operator manual')).toBeTruthy() expect(screen.getByText('1. Start in the browser shell')).toBeTruthy() expect(screen.getByText('Simulator manual')).toBeTruthy() + expect(screen.getByText('Higher-dimensional family guide')).toBeTruthy() + expect(screen.getByText('Deployment readiness manual')).toBeTruthy() + expect(screen.getByText('Input and device posture')).toBeTruthy() + expect(screen.getAllByText('Keyboard and mouse ship today').length).toBeGreaterThan(0) expect(screen.getByText('Feature-registry-backed wording only')).toBeTruthy() expect(await screen.findByRole('link', { name: /open public docs portal/i })).toBeTruthy() }) diff --git a/website/src/pages/public-page-helpers.tsx b/website/src/pages/public-page-helpers.tsx new file mode 100644 index 0000000..b271482 --- /dev/null +++ b/website/src/pages/public-page-helpers.tsx @@ -0,0 +1,88 @@ +import type { ReactNode } from 'react' +import { Link } from 'react-router-dom' +import { + brandConfig, + downloadTargets, + mplSourceUrl, + openSourceRepoUrl, + planCatalog, + publicDocsUrl, + releaseNotesUrl, +} from '../site-config' +import { isExternalHref } from '../site-routes' + +export const supportTopicGuidance: Record = { + 'launch-readiness': { + title: 'Launch readiness', + description: + 'Need help turning the preview lane into a public launch? We can walk through checkout wiring, download release targets, notices, and corresponding-source publication.', + }, + 'operator-access': { + title: 'Operator access', + description: + 'Use this lane when you need operator checkout, entitlement enablement, or help reaching the protected desktop-download surface.', + }, + 'studio-rollout': { + title: 'Studio rollout', + description: + 'Use this lane for higher-dimensional rollout planning, deployment coordination, or production-lane package and notice readiness.', + }, +} + +export const explorerFallbackPlan = planCatalog.find((plan) => plan.key === 'explorer') ?? planCatalog[0] +export const operatorFallbackPlan = planCatalog.find((plan) => plan.key === 'operator') ?? planCatalog[1] +export const studioFallbackPlan = planCatalog.find((plan) => plan.key === 'studio') ?? planCatalog[2] + +export const releaseCommerceFallback = { + operatorCheckoutUrl: isExternalHref(operatorFallbackPlan.ctaHref) ? operatorFallbackPlan.ctaHref : '', + studioCheckoutUrl: isExternalHref(studioFallbackPlan.ctaHref) ? studioFallbackPlan.ctaHref : '', + planPriceOperator: operatorFallbackPlan.price, + planPriceStudio: studioFallbackPlan.price, +} + +export function buildPublicReleaseManifestFallback(supportEmail = brandConfig.contact.email) { + return { + downloadTargets, + publicDocsUrl, + releaseNotesUrl, + correspondingSourceUrl: mplSourceUrl, + openSourceRepoUrl, + supportEmail, + } +} + +export function Section({ + title, + description, + children, +}: { + title: string + description?: string + children: ReactNode +}) { + return ( +
+
+

{title}

+ {description ?

{description}

: null} +
+ {children} +
+ ) +} + +export function PlanActionLink({ href, label }: { href: string; label: string }) { + if (isExternalHref(href)) { + return ( + + {label} + + ) + } + + return ( + + {label} + + ) +} diff --git a/website/src/pages/public-pages-commerce.tsx b/website/src/pages/public-pages-commerce.tsx new file mode 100644 index 0000000..946bb6b --- /dev/null +++ b/website/src/pages/public-pages-commerce.tsx @@ -0,0 +1,536 @@ +import { useMemo } from 'react' +import { useQuery } from '@tanstack/react-query' +import { Link } from 'react-router-dom' +import { getReleaseManifest } from '../auth/auth-api' +import { MarketingShell } from '../components/layout/MarketingShell' +import { SiteMetadata } from '../components/seo/SiteMetadata' +import { PublicLaunchStatus } from '../components/ui/PublicLaunchStatus' +import { ReleaseValidationSummary } from '../components/ui/ReleaseValidationSummary' +import { paddleReadyDescription } from '../site-config' +import { + buildReleaseMetadataItems, + resolveReleaseCommerceView, + resolveReleaseManifestView, +} from '../release-manifest' +import { buildProtectedDownloadPath, buildSupportPath } from '../site-routes' +import { + deliverySurfaceCards, + desktopDownloadSteps, + desktopReleaseSignals, + digitalDeliveryCards, + distributionDoctrineCards, + openSourceNotices, + privacyBoundaryCards, + termsBoundaryCards, +} from '../site-data' +import { + buildPublicReleaseManifestFallback, + explorerFallbackPlan, + operatorFallbackPlan, + PlanActionLink, + releaseCommerceFallback, + Section, + studioFallbackPlan, +} from './public-page-helpers' + +export function PricingPage() { + const releaseManifestQuery = useQuery({ + queryKey: ['release-manifest', 'public'], + queryFn: getReleaseManifest, + retry: false, + }) + const releaseCommerce = useMemo( + () => resolveReleaseCommerceView(releaseManifestQuery.data?.manifest, releaseCommerceFallback), + [releaseManifestQuery.data?.manifest], + ) + const runtimePlanCatalog = useMemo(() => ([ + explorerFallbackPlan, + { + ...operatorFallbackPlan, + price: releaseCommerce.plan_price_operator, + ctaLabel: releaseCommerce.operator_checkout_url ? 'Open Paddle checkout' : 'Request operator access', + ctaHref: releaseCommerce.operator_checkout_url || buildSupportPath('operator-access'), + }, + { + ...studioFallbackPlan, + price: releaseCommerce.plan_price_studio, + ctaLabel: releaseCommerce.studio_checkout_url ? 'Open Paddle checkout' : 'Talk to HyperTwist', + ctaHref: releaseCommerce.studio_checkout_url || buildSupportPath('studio-rollout'), + }, + ]), [releaseCommerce]) + + return ( + <> + + +
+
+ {runtimePlanCatalog.map((plan) => ( +
+

{plan.name}

+

{plan.price}

+

{plan.notes}

+
    + {plan.features.map((feature) => ( +
  • {feature}
  • + ))} +
+ +
+ ))} +
+
+ +
+ +
+ +
+
+ {deliverySurfaceCards.slice(0, 3).map((surface) => ( +
+

{surface.title}

+

{surface.description}

+
+ ))} +
+
+ +
+
+

+ Public pricing, checkout, and download pages are distribution surfaces. Before external launch, + keep their legal footer and open-source notices link live and ensure the corresponding-source URL is configured for any downloadable build containing MPL-covered material. +

+
+
+
+ + ) +} + +export function DownloadPage() { + const releaseManifestQuery = useQuery({ + queryKey: ['release-manifest', 'public'], + queryFn: getReleaseManifest, + retry: false, + }) + + const releaseManifest = useMemo( + () => resolveReleaseManifestView(releaseManifestQuery.data?.manifest, buildPublicReleaseManifestFallback()), + [releaseManifestQuery.data?.manifest], + ) + + return ( + <> + + + {releaseManifestQuery.isLoading ? ( +
+
+

Loading the current server-backed release manifest. Static preview metadata remains visible until the live manifest arrives.

+
+
+ ) : null} + + {releaseManifestQuery.isError ? ( +
+
+

+ The live release manifest could not be loaded from the auth server right now. + This page is showing bounded fallback site metadata instead of current runtime release authority. +

+
+
+ ) : null} + +
+
+ {releaseManifest.platforms.map((platform) => { + const metadataItems = buildReleaseMetadataItems(platform) + return ( +
+

{platform.platform}

+

{platform.subtitle}

+

{platform.details}

+ {metadataItems.length > 0 ? ( +
    + {metadataItems.map((item) => ( +
  • + {item.label}: {item.value} +
  • + ))} +
+ ) : null} + + {platform.configured ? ( + + Sign in for {platform.platform} access + + ) : ( +
+ Release URL not configured yet +
+ )} +
+ ) + })} +
+
+ +
+
+ {desktopDownloadSteps.map((step, index) => ( +
+

{index + 1}

+

{step}

+
+ ))} +
+
+ +
+ +
+ +
+
+ {deliverySurfaceCards.map((surface) => ( +
+

{surface.title}

+

{surface.description}

+
+ ))} +
+
+ +
+
+ {desktopReleaseSignals.map((signal) => ( +
+

{signal.title}

+

{signal.description}

+
+ ))} +
+

Operator rollout references

+ +
+
+
+ +
+
+

+ HyperTwist treats desktop distribution as an account-gated release surface. + Public pages can describe supported targets and release posture, but the actual + download links live behind the protected dashboard where plan and entitlement + state are resolved. +

+ + Sign in to check access + +
+
+ +
+
+

+ After sign-in, open the operator dashboard to generate a desktop-link token. + That token is designed to hand browser identity and plan posture over to the local desktop app without exposing your password. +

+ + Open dashboard + +
+
+
+ + ) +} + +export function OpenSourceNoticesPage() { + const releaseManifestQuery = useQuery({ + queryKey: ['release-manifest', 'public'], + queryFn: getReleaseManifest, + retry: false, + }) + const releaseManifest = useMemo( + () => resolveReleaseManifestView(releaseManifestQuery.data?.manifest, buildPublicReleaseManifestFallback()), + [releaseManifestQuery.data?.manifest], + ) + + return ( + <> + + +
+
+ {openSourceNotices.map((item) => ( +
+

{item.component}

+

{item.license}

+

{item.whyItMatters}

+
+ ))} +
+
+ +
+
+

+ MPL-covered shipped builds need a stable corresponding-source location for the exact distributed material. +

+
    +
  • + Public corresponding-source URL:{' '} + {releaseManifest.corresponding_source_url ? ( + {releaseManifest.corresponding_source_url} + ) : ( + 'configure the public corresponding-source URL before external launch' + )} +
  • +
  • + Public repository / notices reference:{' '} + {releaseManifest.open_source_repo_url ? ( + {releaseManifest.open_source_repo_url} + ) : ( + 'configure the public repository/notices URL before external launch' + )} +
  • +
+

+ Official MPL 2.0 license text:{' '} + + https://www.mozilla.org/en-US/MPL/2.0/ + +

+
+
+ +
+ +
+ +
+
+ {distributionDoctrineCards.map((card) => ( +
+

{card.title}

+

{card.description}

+
    + {card.bullets.map((bullet) => ( +
  • {bullet}
  • + ))} +
+
+ ))} +
+
+
+ + ) +} + +export function PrivacyPage() { + return ( + <> + + +
+
+
    +
  • The public website stores account/session data needed for authentication, plan access, and desktop-link issuance.
  • +
  • The browser shell does not claim ownership over the full simulator runtime state unless a future browser-client packet is explicitly opened.
  • +
  • Support, billing, and release operations should collect only the data required to deliver digital access and maintain legal compliance.
  • +
+
+
+ +
+
+ {privacyBoundaryCards.map((card) => ( +
+

{card.title}

+

{card.description}

+
    + {card.bullets.map((bullet) => ( +
  • {bullet}
  • + ))} +
+
+ ))} +
+
+
+ + ) +} + +export function TermsPage() { + return ( + <> + + +
+
+
    +
  • Browser access covers public pages, account, release, download, and operator/dashboard surfaces.
  • +
  • The simulator itself is delivered through the desktop lane unless a later browser-client branch is explicitly opened.
  • +
  • Downloaded builds and their public distribution pages remain subject to open-source notice and corresponding-source disclosure rules where applicable.
  • +
+
+
+ +
+
+ {termsBoundaryCards.map((card) => ( +
+

{card.title}

+

{card.description}

+
    + {card.bullets.map((bullet) => ( +
  • {bullet}
  • + ))} +
+
+ ))} +
+
+
+ + ) +} + +export function ShippingPaymentPage() { + return ( + <> + + +
+
+

{paddleReadyDescription}

+
    +
  • No physical goods ship through this site.
  • +
  • Pricing and checkout are structured for Paddle-backed digital plans.
  • +
  • Desktop downloads must remain paired with public notices and legal links when required by shipped-code obligations.
  • +
+
+
+ +
+
+ {digitalDeliveryCards.map((card) => ( +
+

{card.title}

+

{card.description}

+
    + {card.bullets.map((bullet) => ( +
  • {bullet}
  • + ))} +
+
+ ))} +
+
+
+ + ) +} diff --git a/website/src/pages/public-pages-marketing.tsx b/website/src/pages/public-pages-marketing.tsx new file mode 100644 index 0000000..8086529 --- /dev/null +++ b/website/src/pages/public-pages-marketing.tsx @@ -0,0 +1,733 @@ +import { useDeferredValue, useMemo, useState } from 'react' +import { useQuery } from '@tanstack/react-query' +import { ArrowRight, BookOpenText, Boxes, Download, ExternalLink, Landmark, MonitorCog, Sparkles } from 'lucide-react' +import { Link, useSearchParams } from 'react-router-dom' +import { getReleaseManifest } from '../auth/auth-api' +import { MarketingShell } from '../components/layout/MarketingShell' +import { SiteMetadata } from '../components/seo/SiteMetadata' +import { PublicLaunchStatus } from '../components/ui/PublicLaunchStatus' +import { brandConfig } from '../site-config' +import { formatReleasePublishedAt, resolveReleaseManifestView } from '../release-manifest' +import { getReleasePlatformValidationSummary } from '../shared/package-validation' +import { + capabilityPillars, + changelogEntries, + companyNarrative, + deliverySurfaceCards, + deploymentReadinessTracks, + heroMetrics, + higherDimensionalRuntimeGuideCards, + inputAndDevicePostureCards, + operatorManualTracks, + operatorPlaybooks, + publicDocumentationPrinciples, + releaseStoryCards, + resourceCollections, + roadmapHonestyCards, + shippingNowCards, + simulatorManualCards, + supportFaqs, +} from '../site-data' +import { buildPublicReleaseManifestFallback, Section, supportTopicGuidance } from './public-page-helpers' + +export function HomeLanding() { + return ( + <> + + +
+
+
+

+ HyperTwist is a native training environment for classic cube, higher-dimensional + families, browser-assisted recognition, replay explanation, and desktop packaging. + The public site is intentionally honest: the desktop runtime is real, the browser + account/dashboard is real, and the optional full-browser simulator path remains spec-only. +

+
+ + Download desktop app + + + Open operator dashboard + + + View pricing + +
+
+
+ HyperTwist symbol +

+ Browser account shell outside the simulator. Native Unreal runtime inside the simulator. +

+
+
+
+ {heroMetrics.map((metric) => ( +
+ {metric.value} + {metric.label} +
+ ))} +
+
+ +
+ +
+ +
+
+ {shippingNowCards.map((item) => ( +
+ +

{item}

+
+ ))} +
+
+ +
+
+ {capabilityPillars.map((pillar) => ( +
+

{pillar.title}

+

{pillar.description}

+
+ ))} +
+
+ +
+
+ {roadmapHonestyCards.map((item) => ( +
+

{item}

+
+ ))} +
+
+ +
+
+
+ +

Browser account and operator shell

+

Authenticated browser access for release posture, desktop pairing, notices, and operator state.

+ + Open dashboard + +
+
+ +

Desktop download and package lane

+

Public download posture for the native Unreal build, with legal linkage already wired in.

+ + Open download center + +
+
+ +

Checkout and notices discipline

+

Paddle-ready pricing plus public notices surfaces for any downloadable build containing MPL-covered material.

+ + Review notices + +
+
+
+ +
+
+ {deliverySurfaceCards.map((surface) => ( +
+

{surface.title}

+

{surface.description}

+
    + {surface.bullets.map((bullet) => ( +
  • {bullet}
  • + ))} +
+
+ ))} +
+
+
+ + ) +} + +export function AboutPage() { + return ( + <> + + +
+
+

{companyNarrative.mission}

+

{companyNarrative.posture}

+

{companyNarrative.distribution}

+
+
+ +
+
+ {deliverySurfaceCards.map((surface) => ( +
+

{surface.title}

+

{surface.description}

+
+ ))} +
+
+ +
+
+
+ +

It treats higher-dimensional puzzles as first-class work

+

120-cell and 5D runtime ownership are not hand-wavy aspirations. They are part of the current product truth.

+
+
+ +

It stays roadmap-honest

+

Shipped, retained, and spec-only surfaces remain clearly separated so public copy matches actual authority.

+
+
+ +

It separates browser shell from simulator truth

+

The public web surface helps operators access the product without pretending the browser already replaces the desktop runtime.

+
+
+
+
+ + ) +} + +export function ResourcesPage() { + const [query, setQuery] = useState('') + const deferredQuery = useDeferredValue(query) + const windowsValidationSummary = getReleasePlatformValidationSummary('windows') + + const filteredCollections = useMemo(() => { + const normalized = deferredQuery.trim().toLowerCase() + if (!normalized) return resourceCollections + return resourceCollections + .map((collection) => ({ + ...collection, + items: collection.items.filter((item) => item.toLowerCase().includes(normalized) || collection.title.toLowerCase().includes(normalized)), + })) + .filter((collection) => collection.items.length > 0) + }, [deferredQuery]) + + return ( + <> + + +
+ + setQuery(event.target.value)} + placeholder="Search training, rollout, notices..." + /> +
+ {filteredCollections.map((collection) => ( +
+

{collection.title}

+
    + {collection.items.map((item) => ( +
  • {item}
  • + ))} +
+
+ ))} +
+
+ +
+
+ + +

Docs landing

+

Product-facing documentation, boundaries, and rollout guidance.

+ + + +

Support

+

Contact, rollout questions, and account/download help.

+ + + +

Release notes

+

Recent public-facing packets and posture updates.

+ +
+
+ +
+
+ {operatorPlaybooks.map((playbook) => ( +
+

{playbook.title}

+
    + {playbook.steps.map((step) => ( +
  • {step}
  • + ))} +
+
+ ))} +
+
+ +
+
+ {simulatorManualCards.map((card) => ( +
+

{card.title}

+

{card.description}

+
    + {card.bullets.map((bullet) => ( +
  • {bullet}
  • + ))} +
+
+ ))} +
+
+ +
+
+ {higherDimensionalRuntimeGuideCards.map((card) => ( +
+

{card.title}

+

{card.description}

+
    + {card.bullets.map((bullet) => ( +
  • {bullet}
  • + ))} +
+
+ ))} +
+
+ +
+
+ {inputAndDevicePostureCards.map((card) => ( +
+

{card.title}

+

{card.description}

+
    + {card.bullets.map((bullet) => ( +
  • {bullet}
  • + ))} +
+
+ ))} +
+
+ +
+
+ {deploymentReadinessTracks.map((track) => ( +
+

{track.title}

+
    + {track.steps.map((step) => ( +
  • {step}
  • + ))} +
+
+ ))} +
+
+ + {windowsValidationSummary ? ( +
+
+

{windowsValidationSummary.lane}

+

+ Latest public-safe package evidence was generated{' '} + {formatReleasePublishedAt(windowsValidationSummary.generated_at) || windowsValidationSummary.generated_at} + {' '}in {windowsValidationSummary.configuration} mode and passed across{' '} + {windowsValidationSummary.smoke_map_count} dedicated-family higher-dimensional training map{windowsValidationSummary.smoke_map_count === 1 ? '' : 's'}. +

+
    + {windowsValidationSummary.smoke_maps.map((map) => ( +
  • + {map.label}: {map.result} +
  • + ))} +
+
+ + Open download center + + + Open operator dashboard + +
+
+
+ ) : null} +
+ + ) +} + +export function DocsPage() { + const releaseManifestQuery = useQuery({ + queryKey: ['release-manifest', 'public'], + queryFn: getReleaseManifest, + retry: false, + }) + const releaseManifest = useMemo( + () => resolveReleaseManifestView(releaseManifestQuery.data?.manifest, buildPublicReleaseManifestFallback()), + [releaseManifestQuery.data?.manifest], + ) + + return ( + <> + + +
+
+ {publicDocumentationPrinciples.map((principle) => ( +
+

{principle.title}

+

{principle.description}

+
+ ))} +
+
+ +
+
+ {operatorManualTracks.map((track) => ( +
+

{track.title}

+

{track.description}

+
    + {track.steps.map((step) => ( +
  • {step}
  • + ))} +
+
+ ))} +
+
+ +
+
+ {deliverySurfaceCards.map((surface) => ( +
+

{surface.title}

+

{surface.description}

+
+ ))} +
+
+ +
+
+ {simulatorManualCards.map((card) => ( +
+

{card.title}

+

{card.description}

+
    + {card.bullets.map((bullet) => ( +
  • {bullet}
  • + ))} +
+
+ ))} +
+
+ +
+
+ {higherDimensionalRuntimeGuideCards.map((card) => ( +
+

{card.title}

+

{card.description}

+
    + {card.bullets.map((bullet) => ( +
  • {bullet}
  • + ))} +
+
+ ))} +
+
+ +
+
+ {deploymentReadinessTracks.map((track) => ( +
+

{track.title}

+
    + {track.steps.map((step) => ( +
  • {step}
  • + ))} +
+
+ ))} +
+
+ +
+
+ {inputAndDevicePostureCards.map((card) => ( +
+

{card.title}

+

{card.description}

+
    + {card.bullets.map((bullet) => ( +
  • {bullet}
  • + ))} +
+
+ ))} +
+
+ + {releaseManifest.public_docs_url ? ( +
+ + Open public docs portal + +
+ ) : null} +
+ + ) +} + +export function SupportPage() { + const [searchParams] = useSearchParams() + const supportTopic = searchParams.get('topic') + const selectedSupportTopic = supportTopic ? supportTopicGuidance[supportTopic] : null + + return ( + <> + + + {selectedSupportTopic ? ( +
+
+

{selectedSupportTopic.title}

+

{selectedSupportTopic.description}

+
+
+ ) : null} + +
+ +
+ +
+
+ {supportFaqs.map((faq) => ( +
+

{faq.question}

+

{faq.answer}

+
+ ))} +
+
+ +
+
+ {operatorPlaybooks.map((playbook) => ( +
+

{playbook.title}

+
    + {playbook.steps.map((step) => ( +
  • {step}
  • + ))} +
+
+ ))} +
+
+
+ + ) +} + +export function ChangelogPage() { + const releaseManifestQuery = useQuery({ + queryKey: ['release-manifest', 'public'], + queryFn: getReleaseManifest, + retry: false, + }) + const releaseManifest = useMemo( + () => resolveReleaseManifestView(releaseManifestQuery.data?.manifest, buildPublicReleaseManifestFallback()), + [releaseManifestQuery.data?.manifest], + ) + + return ( + <> + + +
+
+ {changelogEntries.map((entry) => ( +
+

{entry.date}

+

{entry.title}

+

{entry.details}

+
+ ))} +
+
+ +
+
+ {releaseStoryCards.map((card) => ( +
+

{card.title}

+

{card.description}

+
    + {card.bullets.map((bullet) => ( +
  • {bullet}
  • + ))} +
+
+ ))} +
+
+ + {releaseManifest.release_notes_url ? ( +
+ + Open release feed + +
+ ) : null} +
+ + ) +} diff --git a/website/src/pages/public-pages.tsx b/website/src/pages/public-pages.tsx index bfa6e20..87a1970 100644 --- a/website/src/pages/public-pages.tsx +++ b/website/src/pages/public-pages.tsx @@ -1,1215 +1,2 @@ -import { useDeferredValue, useMemo, useState } from 'react' -import { useQuery } from '@tanstack/react-query' -import { ArrowRight, BookOpenText, Boxes, Download, ExternalLink, Landmark, MonitorCog, Sparkles } from 'lucide-react' -import { Link, useSearchParams } from 'react-router-dom' -import { getReleaseManifest } from '../auth/auth-api' -import { MarketingShell } from '../components/layout/MarketingShell' -import { SiteMetadata } from '../components/seo/SiteMetadata' -import { PublicLaunchStatus } from '../components/ui/PublicLaunchStatus' -import { ReleaseValidationSummary } from '../components/ui/ReleaseValidationSummary' -import { - brandConfig, - downloadTargets, - mplSourceUrl, - openSourceRepoUrl, - paddleReadyDescription, - planCatalog, - publicDocsUrl, - releaseNotesUrl, -} from '../site-config' -import { - buildReleaseMetadataItems, - formatReleasePublishedAt, - resolveReleaseCommerceView, - resolveReleaseManifestView, -} from '../release-manifest' -import { getReleasePlatformValidationSummary } from '../shared/package-validation' -import { buildProtectedDownloadPath, buildSupportPath, isExternalHref } from '../site-routes' -import { - capabilityPillars, - changelogEntries, - companyNarrative, - desktopDownloadSteps, - desktopReleaseSignals, - deliverySurfaceCards, - digitalDeliveryCards, - distributionDoctrineCards, - heroMetrics, - openSourceNotices, - operatorManualTracks, - operatorPlaybooks, - privacyBoundaryCards, - publicDocumentationPrinciples, - resourceCollections, - releaseStoryCards, - roadmapHonestyCards, - shippingNowCards, - simulatorManualCards, - supportFaqs, - termsBoundaryCards, -} from '../site-data' - -const supportTopicGuidance: Record = { - 'launch-readiness': { - title: 'Launch readiness', - description: 'Need help turning the preview lane into a public launch? We can walk through checkout wiring, download release targets, notices, and corresponding-source publication.', - }, - 'operator-access': { - title: 'Operator access', - description: 'Use this lane when you need operator checkout, entitlement enablement, or help reaching the protected desktop-download surface.', - }, - 'studio-rollout': { - title: 'Studio rollout', - description: 'Use this lane for higher-dimensional rollout planning, deployment coordination, or production-lane package and notice readiness.', - }, -} - -const explorerFallbackPlan = planCatalog.find((plan) => plan.key === 'explorer') ?? planCatalog[0] -const operatorFallbackPlan = planCatalog.find((plan) => plan.key === 'operator') ?? planCatalog[1] -const studioFallbackPlan = planCatalog.find((plan) => plan.key === 'studio') ?? planCatalog[2] - -const releaseCommerceFallback = { - operatorCheckoutUrl: isExternalHref(operatorFallbackPlan.ctaHref) ? operatorFallbackPlan.ctaHref : '', - studioCheckoutUrl: isExternalHref(studioFallbackPlan.ctaHref) ? studioFallbackPlan.ctaHref : '', - planPriceOperator: operatorFallbackPlan.price, - planPriceStudio: studioFallbackPlan.price, -} - -function buildPublicReleaseManifestFallback(supportEmail = brandConfig.contact.email) { - return { - downloadTargets, - publicDocsUrl, - releaseNotesUrl, - correspondingSourceUrl: mplSourceUrl, - openSourceRepoUrl, - supportEmail, - } -} - -function Section({ - title, - description, - children, -}: { - title: string - description?: string - children: React.ReactNode -}) { - return ( -
-
-

{title}

- {description ?

{description}

: null} -
- {children} -
- ) -} - -function PlanActionLink({ href, label }: { href: string; label: string }) { - if (isExternalHref(href)) { - return ( - - {label} - - ) - } - - return ( - - {label} - - ) -} - -export function HomeLanding() { - return ( - <> - - -
-
-
-

- HyperTwist is a native training environment for classic cube, higher-dimensional - families, browser-assisted recognition, replay explanation, and desktop packaging. - The public site is intentionally honest: the desktop runtime is real, the browser - account/dashboard is real, and the optional full-browser simulator path remains spec-only. -

-
- - Download desktop app - - - Open operator dashboard - - - View pricing - -
-
-
- HyperTwist symbol -

- Browser account shell outside the simulator. Native Unreal runtime inside the simulator. -

-
-
-
- {heroMetrics.map((metric) => ( -
- {metric.value} - {metric.label} -
- ))} -
-
- -
- -
- -
-
- {shippingNowCards.map((item) => ( -
- -

{item}

-
- ))} -
-
- -
-
- {capabilityPillars.map((pillar) => ( -
-

{pillar.title}

-

{pillar.description}

-
- ))} -
-
- -
-
- {roadmapHonestyCards.map((item) => ( -
-

{item}

-
- ))} -
-
- -
-
-
- -

Browser account and operator shell

-

Authenticated browser access for release posture, desktop pairing, notices, and operator state.

- - Open dashboard - -
-
- -

Desktop download and package lane

-

Public download posture for the native Unreal build, with legal linkage already wired in.

- - Open download center - -
-
- -

Checkout and notices discipline

-

Paddle-ready pricing plus public notices surfaces for any downloadable build containing MPL-covered material.

- - Review notices - -
-
-
- -
-
- {deliverySurfaceCards.map((surface) => ( -
-

{surface.title}

-

{surface.description}

-
    - {surface.bullets.map((bullet) => ( -
  • {bullet}
  • - ))} -
-
- ))} -
-
-
- - ) -} - -export function AboutPage() { - return ( - <> - - -
-
-

{companyNarrative.mission}

-

{companyNarrative.posture}

-

{companyNarrative.distribution}

-
-
- -
-
- {deliverySurfaceCards.map((surface) => ( -
-

{surface.title}

-

{surface.description}

-
- ))} -
-
- -
-
-
- -

It treats higher-dimensional puzzles as first-class work

-

120-cell and 5D runtime ownership are not hand-wavy aspirations. They are part of the current product truth.

-
-
- -

It stays roadmap-honest

-

Shipped, retained, and spec-only surfaces remain clearly separated so public copy matches actual authority.

-
-
- -

It separates browser shell from simulator truth

-

The public web surface helps operators access the product without pretending the browser already replaces the desktop runtime.

-
-
-
-
- - ) -} - -export function ResourcesPage() { - const [query, setQuery] = useState('') - const deferredQuery = useDeferredValue(query) - const windowsValidationSummary = getReleasePlatformValidationSummary('windows') - - const filteredCollections = useMemo(() => { - const normalized = deferredQuery.trim().toLowerCase() - if (!normalized) return resourceCollections - return resourceCollections - .map((collection) => ({ - ...collection, - items: collection.items.filter((item) => item.toLowerCase().includes(normalized) || collection.title.toLowerCase().includes(normalized)), - })) - .filter((collection) => collection.items.length > 0) - }, [deferredQuery]) - - return ( - <> - - -
- - setQuery(event.target.value)} - placeholder="Search training, rollout, notices..." - /> -
- {filteredCollections.map((collection) => ( -
-

{collection.title}

-
    - {collection.items.map((item) => ( -
  • {item}
  • - ))} -
-
- ))} -
-
- -
-
- - -

Docs landing

-

Product-facing documentation, boundaries, and rollout guidance.

- - - -

Support

-

Contact, rollout questions, and account/download help.

- - - -

Release notes

-

Recent public-facing packets and posture updates.

- -
-
- -
-
- {operatorPlaybooks.map((playbook) => ( -
-

{playbook.title}

-
    - {playbook.steps.map((step) => ( -
  • {step}
  • - ))} -
-
- ))} -
-
- -
-
- {simulatorManualCards.map((card) => ( -
-

{card.title}

-

{card.description}

-
    - {card.bullets.map((bullet) => ( -
  • {bullet}
  • - ))} -
-
- ))} -
-
- - {windowsValidationSummary ? ( -
-
-

{windowsValidationSummary.lane}

-

- Latest public-safe package evidence was generated{' '} - {formatReleasePublishedAt(windowsValidationSummary.generated_at) || windowsValidationSummary.generated_at} - {' '}in {windowsValidationSummary.configuration} mode and passed across{' '} - {windowsValidationSummary.smoke_map_count} dedicated-family higher-dimensional training map{windowsValidationSummary.smoke_map_count === 1 ? '' : 's'}. -

-
    - {windowsValidationSummary.smoke_maps.map((map) => ( -
  • - {map.label}: {map.result} -
  • - ))} -
-
- - Open download center - - - Open operator dashboard - -
-
-
- ) : null} -
- - ) -} - -export function DocsPage() { - const releaseManifestQuery = useQuery({ - queryKey: ['release-manifest', 'public'], - queryFn: getReleaseManifest, - retry: false, - }) - const releaseManifest = useMemo( - () => resolveReleaseManifestView(releaseManifestQuery.data?.manifest, buildPublicReleaseManifestFallback()), - [releaseManifestQuery.data?.manifest], - ) - - return ( - <> - - -
-
- {publicDocumentationPrinciples.map((principle) => ( -
-

{principle.title}

-

{principle.description}

-
- ))} -
-
- -
-
- {operatorManualTracks.map((track) => ( -
-

{track.title}

-

{track.description}

-
    - {track.steps.map((step) => ( -
  • {step}
  • - ))} -
-
- ))} -
-
- -
-
- {deliverySurfaceCards.map((surface) => ( -
-

{surface.title}

-

{surface.description}

-
- ))} -
-
- -
-
- {simulatorManualCards.map((card) => ( -
-

{card.title}

-

{card.description}

-
    - {card.bullets.map((bullet) => ( -
  • {bullet}
  • - ))} -
-
- ))} -
-
- - {releaseManifest.public_docs_url ? ( -
- - Open public docs portal - -
- ) : null} -
- - ) -} - -export function SupportPage() { - const [searchParams] = useSearchParams() - const supportTopic = searchParams.get('topic') - const selectedSupportTopic = supportTopic ? supportTopicGuidance[supportTopic] : null - - return ( - <> - - - {selectedSupportTopic ? ( -
-
-

{selectedSupportTopic.title}

-

{selectedSupportTopic.description}

-
-
- ) : null} - -
- -
- -
-
- {supportFaqs.map((faq) => ( -
-

{faq.question}

-

{faq.answer}

-
- ))} -
-
- -
-
- {operatorPlaybooks.map((playbook) => ( -
-

{playbook.title}

-
    - {playbook.steps.map((step) => ( -
  • {step}
  • - ))} -
-
- ))} -
-
-
- - ) -} - -export function ChangelogPage() { - const releaseManifestQuery = useQuery({ - queryKey: ['release-manifest', 'public'], - queryFn: getReleaseManifest, - retry: false, - }) - const releaseManifest = useMemo( - () => resolveReleaseManifestView(releaseManifestQuery.data?.manifest, buildPublicReleaseManifestFallback()), - [releaseManifestQuery.data?.manifest], - ) - - return ( - <> - - -
-
- {changelogEntries.map((entry) => ( -
-

{entry.date}

-

{entry.title}

-

{entry.details}

-
- ))} -
-
- -
-
- {releaseStoryCards.map((card) => ( -
-

{card.title}

-

{card.description}

-
    - {card.bullets.map((bullet) => ( -
  • {bullet}
  • - ))} -
-
- ))} -
-
- - {releaseManifest.release_notes_url ? ( -
- - Open release feed - -
- ) : null} -
- - ) -} - -export function PricingPage() { - const releaseManifestQuery = useQuery({ - queryKey: ['release-manifest', 'public'], - queryFn: getReleaseManifest, - retry: false, - }) - const releaseCommerce = useMemo( - () => resolveReleaseCommerceView(releaseManifestQuery.data?.manifest, releaseCommerceFallback), - [releaseManifestQuery.data?.manifest], - ) - const runtimePlanCatalog = useMemo(() => ([ - explorerFallbackPlan, - { - ...operatorFallbackPlan, - price: releaseCommerce.plan_price_operator, - ctaLabel: releaseCommerce.operator_checkout_url ? 'Open Paddle checkout' : 'Request operator access', - ctaHref: releaseCommerce.operator_checkout_url || buildSupportPath('operator-access'), - }, - { - ...studioFallbackPlan, - price: releaseCommerce.plan_price_studio, - ctaLabel: releaseCommerce.studio_checkout_url ? 'Open Paddle checkout' : 'Talk to HyperTwist', - ctaHref: releaseCommerce.studio_checkout_url || buildSupportPath('studio-rollout'), - }, - ]), [releaseCommerce]) - - return ( - <> - - -
-
- {runtimePlanCatalog.map((plan) => ( -
-

{plan.name}

-

{plan.price}

-

{plan.notes}

-
    - {plan.features.map((feature) => ( -
  • {feature}
  • - ))} -
- -
- ))} -
-
- -
- -
- -
-
- {deliverySurfaceCards.slice(0, 3).map((surface) => ( -
-

{surface.title}

-

{surface.description}

-
- ))} -
-
- -
-
-

- Public pricing, checkout, and download pages are distribution surfaces. Before external launch, - keep their legal footer and open-source notices link live and ensure the corresponding-source URL is configured for any downloadable build containing MPL-covered material. -

-
-
-
- - ) -} - -export function DownloadPage() { - const releaseManifestQuery = useQuery({ - queryKey: ['release-manifest', 'public'], - queryFn: getReleaseManifest, - retry: false, - }) - - const releaseManifest = useMemo( - () => resolveReleaseManifestView(releaseManifestQuery.data?.manifest, buildPublicReleaseManifestFallback()), - [releaseManifestQuery.data?.manifest], - ) - - return ( - <> - - - {releaseManifestQuery.isLoading ? ( -
-
-

Loading the current server-backed release manifest. Static preview metadata remains visible until the live manifest arrives.

-
-
- ) : null} - - {releaseManifestQuery.isError ? ( -
-
-

- The live release manifest could not be loaded from the auth server right now. - This page is showing bounded fallback site metadata instead of current runtime release authority. -

-
-
- ) : null} - -
-
- {releaseManifest.platforms.map((platform) => { - const metadataItems = buildReleaseMetadataItems(platform) - return ( -
-

{platform.platform}

-

{platform.subtitle}

-

{platform.details}

- {metadataItems.length > 0 ? ( -
    - {metadataItems.map((item) => ( -
  • - {item.label}: {item.value} -
  • - ))} -
- ) : null} - - {platform.configured ? ( - - Sign in for {platform.platform} access - - ) : ( -
- Release URL not configured yet -
- )} -
- ) - })} -
-
- -
-
- {desktopDownloadSteps.map((step, index) => ( -
-

{index + 1}

-

{step}

-
- ))} -
-
- -
- -
- -
-
- {deliverySurfaceCards.map((surface) => ( -
-

{surface.title}

-

{surface.description}

-
- ))} -
-
- -
-
- {desktopReleaseSignals.map((signal) => ( -
-

{signal.title}

-

{signal.description}

-
- ))} -
-

Operator rollout references

- -
-
-
- -
-
-

- HyperTwist treats desktop distribution as an account-gated release surface. - Public pages can describe supported targets and release posture, but the actual - download links live behind the protected dashboard where plan and entitlement - state are resolved. -

- - Sign in to check access - -
-
- -
-
-

- After sign-in, open the operator dashboard to generate a desktop-link token. - That token is designed to hand browser identity and plan posture over to the local desktop app without exposing your password. -

- - Open dashboard - -
-
-
- - ) -} - -export function OpenSourceNoticesPage() { - const releaseManifestQuery = useQuery({ - queryKey: ['release-manifest', 'public'], - queryFn: getReleaseManifest, - retry: false, - }) - const releaseManifest = useMemo( - () => resolveReleaseManifestView(releaseManifestQuery.data?.manifest, buildPublicReleaseManifestFallback()), - [releaseManifestQuery.data?.manifest], - ) - - return ( - <> - - -
-
- {openSourceNotices.map((item) => ( -
-

{item.component}

-

{item.license}

-

{item.whyItMatters}

-
- ))} -
-
- -
-
-

- MPL-covered shipped builds need a stable corresponding-source location for the exact distributed material. -

-
    -
  • - Public corresponding-source URL:{' '} - {releaseManifest.corresponding_source_url ? ( - {releaseManifest.corresponding_source_url} - ) : ( - 'configure the public corresponding-source URL before external launch' - )} -
  • -
  • - Public repository / notices reference:{' '} - {releaseManifest.open_source_repo_url ? ( - {releaseManifest.open_source_repo_url} - ) : ( - 'configure the public repository/notices URL before external launch' - )} -
  • -
-

- Official MPL 2.0 license text:{' '} - - https://www.mozilla.org/en-US/MPL/2.0/ - -

-
-
- -
- -
- -
-
- {distributionDoctrineCards.map((card) => ( -
-

{card.title}

-

{card.description}

-
    - {card.bullets.map((bullet) => ( -
  • {bullet}
  • - ))} -
-
- ))} -
-
-
- - ) -} - -export function PrivacyPage() { - return ( - <> - - -
-
-
    -
  • The public website stores account/session data needed for authentication, plan access, and desktop-link issuance.
  • -
  • The browser shell does not claim ownership over the full simulator runtime state unless a future browser-client packet is explicitly opened.
  • -
  • Support, billing, and release operations should collect only the data required to deliver digital access and maintain legal compliance.
  • -
-
-
- -
-
- {privacyBoundaryCards.map((card) => ( -
-

{card.title}

-

{card.description}

-
    - {card.bullets.map((bullet) => ( -
  • {bullet}
  • - ))} -
-
- ))} -
-
-
- - ) -} - -export function TermsPage() { - return ( - <> - - -
-
-
    -
  • Browser access covers public pages, account, release, download, and operator/dashboard surfaces.
  • -
  • The simulator itself is delivered through the desktop lane unless a later browser-client branch is explicitly opened.
  • -
  • Downloaded builds and their public distribution pages remain subject to open-source notice and corresponding-source disclosure rules where applicable.
  • -
-
-
- -
-
- {termsBoundaryCards.map((card) => ( -
-

{card.title}

-

{card.description}

-
    - {card.bullets.map((bullet) => ( -
  • {bullet}
  • - ))} -
-
- ))} -
-
-
- - ) -} - -export function ShippingPaymentPage() { - return ( - <> - - -
-
-

{paddleReadyDescription}

-
    -
  • No physical goods ship through this site.
  • -
  • Pricing and checkout are structured for Paddle-backed digital plans.
  • -
  • Desktop downloads must remain paired with public notices and legal links when required by shipped-code obligations.
  • -
-
-
- -
-
- {digitalDeliveryCards.map((card) => ( -
-

{card.title}

-

{card.description}

-
    - {card.bullets.map((bullet) => ( -
  • {bullet}
  • - ))} -
-
- ))} -
-
-
- - ) -} +export * from './public-pages-marketing' +export * from './public-pages-commerce' diff --git a/website/src/router/PublicRoutes.tsx b/website/src/router/PublicRoutes.tsx index 97817fe..41251aa 100644 --- a/website/src/router/PublicRoutes.tsx +++ b/website/src/router/PublicRoutes.tsx @@ -2,18 +2,18 @@ import { Suspense, lazy, type ReactNode } from 'react' import { Route } from 'react-router-dom' import { GeneralPageLoader } from '../components/ui/Skeletons' -const HomeLanding = lazy(() => import('../pages/public-pages').then((m) => ({ default: m.HomeLanding }))) -const AboutPage = lazy(() => import('../pages/public-pages').then((m) => ({ default: m.AboutPage }))) -const ResourcesPage = lazy(() => import('../pages/public-pages').then((m) => ({ default: m.ResourcesPage }))) -const DocsPage = lazy(() => import('../pages/public-pages').then((m) => ({ default: m.DocsPage }))) -const SupportPage = lazy(() => import('../pages/public-pages').then((m) => ({ default: m.SupportPage }))) -const ChangelogPage = lazy(() => import('../pages/public-pages').then((m) => ({ default: m.ChangelogPage }))) -const PricingPage = lazy(() => import('../pages/public-pages').then((m) => ({ default: m.PricingPage }))) -const DownloadPage = lazy(() => import('../pages/public-pages').then((m) => ({ default: m.DownloadPage }))) -const OpenSourceNoticesPage = lazy(() => import('../pages/public-pages').then((m) => ({ default: m.OpenSourceNoticesPage }))) -const PrivacyPage = lazy(() => import('../pages/public-pages').then((m) => ({ default: m.PrivacyPage }))) -const TermsPage = lazy(() => import('../pages/public-pages').then((m) => ({ default: m.TermsPage }))) -const ShippingPaymentPage = lazy(() => import('../pages/public-pages').then((m) => ({ default: m.ShippingPaymentPage }))) +const HomeLanding = lazy(() => import('../pages/public-pages-marketing').then((m) => ({ default: m.HomeLanding }))) +const AboutPage = lazy(() => import('../pages/public-pages-marketing').then((m) => ({ default: m.AboutPage }))) +const ResourcesPage = lazy(() => import('../pages/public-pages-marketing').then((m) => ({ default: m.ResourcesPage }))) +const DocsPage = lazy(() => import('../pages/public-pages-marketing').then((m) => ({ default: m.DocsPage }))) +const SupportPage = lazy(() => import('../pages/public-pages-marketing').then((m) => ({ default: m.SupportPage }))) +const ChangelogPage = lazy(() => import('../pages/public-pages-marketing').then((m) => ({ default: m.ChangelogPage }))) +const PricingPage = lazy(() => import('../pages/public-pages-commerce').then((m) => ({ default: m.PricingPage }))) +const DownloadPage = lazy(() => import('../pages/public-pages-commerce').then((m) => ({ default: m.DownloadPage }))) +const OpenSourceNoticesPage = lazy(() => import('../pages/public-pages-commerce').then((m) => ({ default: m.OpenSourceNoticesPage }))) +const PrivacyPage = lazy(() => import('../pages/public-pages-commerce').then((m) => ({ default: m.PrivacyPage }))) +const TermsPage = lazy(() => import('../pages/public-pages-commerce').then((m) => ({ default: m.TermsPage }))) +const ShippingPaymentPage = lazy(() => import('../pages/public-pages-commerce').then((m) => ({ default: m.ShippingPaymentPage }))) const LoginPage = lazy(() => import('../pages/auth-pages').then((m) => ({ default: m.LoginPage }))) const RegisterPage = lazy(() => import('../pages/auth-pages').then((m) => ({ default: m.RegisterPage }))) diff --git a/website/src/site-data.ts b/website/src/site-data.ts index b5979f5..14fb499 100644 --- a/website/src/site-data.ts +++ b/website/src/site-data.ts @@ -168,6 +168,93 @@ export const simulatorManualCards = [ }, ] as const +export const higherDimensionalRuntimeGuideCards = [ + { + title: 'Magic120Cell packaged runtime', + description: 'Use the packaged native training lane when you need real 120-cell runtime-state, projection ownership, and persistence-aware family behavior.', + bullets: [ + 'Launch the dedicated Magic120Cell training map from the desktop runtime.', + 'Use the current symmetry, focus, and logical-visibility posture as the authoritative first-party runtime owner.', + 'Treat the public website as documentation and rollout support, not as the runtime that executes this family.', + ], + }, + { + title: 'MagicCube5D packaged runtime', + description: 'Use the packaged native training lane when you need real 5D projection, stereo, focus, and face-visibility ownership.', + bullets: [ + 'Launch the dedicated MagicCube5D training map from the desktop runtime.', + 'Use the current projection-distance, stereo, and visibility defaults as the bounded first-party runtime posture.', + 'Keep this lane described honestly as packaged native behavior rather than browser simulator parity.', + ], + }, + { + title: 'MagicTile embedded-browser runtime', + description: 'Use the embedded browser lane for the current non-Euclidean tiling host posture while native renderer widening remains intentionally gated.', + bullets: [ + 'Treat the embedded browser/CEF shell as the current shipped host for the live MagicTile interaction lane.', + 'Keep shared scramble normalization, timer transport, and state-bridge ownership attached to the first-party native shell and bridge.', + 'Do not describe a separate native renderer port as live while the renderer-widening gate stays explicit No-Go.', + ], + }, +] as const + +export const inputAndDevicePostureCards = [ + { + title: 'Keyboard and mouse ship today', + description: 'Classic-cube play and bounded keyboard-driven higher-dimensional interaction are already real current product lanes.', + bullets: [ + 'Classic-cube runtime input already includes click, touch, orbit, zoom, and bounded keyboard move intent.', + 'The current classic keyboard profile is the shipped `classic-wca-keyboard/v1` mapping.', + 'Treat this as real simulator input ownership, not as a browser-side placeholder.', + ], + }, + { + title: 'Higher-dimensional view controls are already owned', + description: 'Magic120Cell and MagicCube5D already carry first-party projection, focus, symmetry or stereo, and visibility defaults in the packaged runtime.', + bullets: [ + 'Magic120Cell keeps symmetry, logical-visibility depth, and center-cell focus posture explicit.', + 'MagicCube5D keeps projection-distance, stereo, face-visibility, and focus posture explicit.', + 'These controls belong to the dedicated-family desktop runtime lanes, not to the public website.', + ], + }, + { + title: 'XR groundwork exists, but the full VR lane is not finished', + description: 'EnhancedInput posture and motion-controller groundwork exist, but HyperTwist does not yet market a fully finished OpenXR/controller/rebinding runtime lane.', + bullets: [ + 'Project config already carries EnhancedInput plus Vive, Oculus Touch, Mixed Reality, and Valve Index axis groundwork.', + 'Current product truth should not overclaim headset-specific runtime ownership or polished user-facing input rebinding.', + 'A later native XR completion packet still needs dedicated runtime owners, user-facing settings, and Windows package validation with controller truth.', + ], + }, +] as const + +export const deploymentReadinessTracks = [ + { + title: '1. Identity and access posture', + steps: [ + 'Confirm shared browser auth is live before inviting operators into the protected release lane.', + 'Use the protected dashboard to resolve plan, entitlement, and desktop-link token posture.', + 'Keep browser-to-desktop handoff explicit so the installed app never depends on password reuse.', + ], + }, + { + title: '2. Release and package posture', + steps: [ + 'Publish release-manifest truth for the active desktop targets before widening any public launch language.', + 'Keep package validation proof visible beside download posture so rollout remains evidence-backed.', + 'Differentiate browser-shell changes from simulator/package changes in release notes and support guidance.', + ], + }, + { + title: '3. Legal and source posture', + steps: [ + 'Keep notices and corresponding-source links visible anywhere pricing, checkout, or downloads are exposed.', + 'Treat public pricing/download surfaces as part of the distributed product, not detached brochure pages.', + 'Do not let launch copy outrun the actual checkout, release, or source-availability configuration.', + ], + }, +] as const + export const publicDocumentationPrinciples = [ { title: 'Feature-registry-backed wording only', @@ -388,6 +475,15 @@ export const resourceCollections = [ '120-cell and 5D dedicated-family runtime ownership overview', ], }, + { + title: 'Deployment readiness', + items: [ + 'Shared auth and browser-to-desktop pairing posture', + 'Package validation proof and release-manifest interpretation', + 'Pricing, checkout, notices, and corresponding-source coordination', + 'Launch-readiness distinction between preview, protected, and public lanes', + ], + }, ] as const export const changelogEntries = [ @@ -454,6 +550,18 @@ export const supportFaqs = [ question: 'Is the simulator fully in the browser?', answer: 'No. The current shipping lane is desktop-first and Unreal-backed. The public website offers account, operator, support, and download access, while the optional full-browser simulator path remains spec-only.', }, + { + question: 'If the desktop app is primary, why keep the web version?', + answer: 'Because the browser shell owns the parts that should stay outside the simulator: public positioning, account access, billing, release posture, download gating, notices, and browser-to-desktop pairing. Keeping that work on the web makes the native runtime easier to trust and easier to operate.', + }, + { + question: 'Is VR/controller support already fully finished?', + answer: 'Not yet. HyperTwist already has real EnhancedInput posture and motion-controller groundwork, but it does not yet claim a fully finished OpenXR/controller/runtime or polished rebinding lane.', + }, + { + question: 'Can I already customize controls and higher-dimensional view posture?', + answer: 'Partly. The current desktop runtime already owns the classic keyboard profile plus higher-dimensional projection, focus, and visibility defaults, but a broader polished user-facing preferences and rebinding layer is still a later native packet.', + }, { question: 'Can I download a build immediately after sign-in?', answer: 'Yes, once a release URL is configured for your plan. The dashboard also exposes a desktop-link token so the browser account can pair with the desktop app safely.',