From 69290897dee84029b981d06320c8a06ea5493dbd Mon Sep 17 00:00:00 2001 From: axiomlogicnexus Date: Wed, 6 May 2026 18:59:16 +0200 Subject: [PATCH] Preserve review carryover through run finalization --- .../HyperTwistTrainingRepositoryLibrary.cpp | 4 +- ..._CARRYOVER_CONTINUITY_PACKET_2026-05-06.md | 96 +++++++++++++++++++ 2 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 docs/arch/HYPERTWIST_PHASE4_REVIEW_FINALIZATION_CARRYOVER_CONTINUITY_PACKET_2026-05-06.md diff --git a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp index ced97a2..e25aef8 100644 --- a/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp +++ b/UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp @@ -29939,7 +29939,7 @@ FHyperTwistTrainingReviewPlanState UHyperTwistTrainingRepositoryLibrary::Finaliz return UpdatedPlan; } - UpdatedPlan.bCompleted = true; + UpdatedPlan.bCompleted = false; UpdatedPlan.CurrentEntryIndex = INDEX_NONE; UpdatedPlan.CompletedAtUtc = !Session.EndedAtUtc.IsEmpty() ? Session.EndedAtUtc @@ -29955,5 +29955,5 @@ FHyperTwistTrainingReviewPlanState UHyperTwistTrainingRepositoryLibrary::Finaliz } } - return UpdatedPlan; + return HyperTwistTrainingRepositoryLibraryInternal::NormalizeReviewPlanState(UpdatedPlan); } diff --git a/docs/arch/HYPERTWIST_PHASE4_REVIEW_FINALIZATION_CARRYOVER_CONTINUITY_PACKET_2026-05-06.md b/docs/arch/HYPERTWIST_PHASE4_REVIEW_FINALIZATION_CARRYOVER_CONTINUITY_PACKET_2026-05-06.md new file mode 100644 index 0000000..ce1628b --- /dev/null +++ b/docs/arch/HYPERTWIST_PHASE4_REVIEW_FINALIZATION_CARRYOVER_CONTINUITY_PACKET_2026-05-06.md @@ -0,0 +1,96 @@ +# HyperTwist Phase 4 review finalization carryover continuity packet + +Created on `2026-05-06` + +Status: + +- first-party HyperTwist packet +- bounded Phase `4` coach-to-review validation slice + +## Purpose + +This packet closes the next review-finalization continuity gap in the live recognition-assisted coach-to-review loop. + +The open task is: + +- preserve unfinished review carryover and coach-pressure state when a review run is explicitly completed before the underlying review plan is actually exhausted + +It is not: + +- a new recognition transport packet +- a new review-policy heuristic packet +- a queue packet +- a broad review-plan redesign + +## Scope + +Bounded lane: + +- fix the explicit review-run finalization path so it no longer force-closes review plans that still have non-terminal work +- let the existing review-plan normalizer decide whether the plan is actually complete after finalization-state adjustments +- keep the change local to repository-layer review-plan closure behavior + +Out of scope: + +- new replay scoring +- new dashboard layout work +- broader coach-action or queue heuristics + +## Why this was the right next packet + +Before this slice: + +- queue-backed brief continuity, queue-launch continuity, and review-start summary continuity were already landed +- the review-program summary already shaped downstream coach pressure, source review-plan linkage, and dashboard-adjacent inspection +- review attempts and review-run finalization already refreshed repository views in the subsystem + +But the explicit review-finalization rule still had one hard continuity break: + +- `FinalizeReviewPlan()` unconditionally set `bCompleted = true` +- it then converted the current entry back to `Pending` for non-aborted completion or `Skipped` for abort +- completed plans are excluded from pending-plan and carryover accounting in `DeriveReviewProgramSummary()` + +That meant a review run could end with unresolved review work still present, while the repository summary and downstream coach state treated the plan as fully closed. + +The practical consequence was: + +- carryover pressure could disappear from `PendingPlanCount`, `CarryoverCaseCount`, `CurrentPlanId`, and `bNeedsCoachIntervention` +- post-review coach feedback could read as if the review program had cleanly closed when it had only been interrupted + +So the next honest move was: + +- stop force-closing review plans at explicit run finalization and let the normalized plan state decide whether closure is real + +## What landed + +Primary code changes: + +- `UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistTrainingRepositoryLibrary.cpp` + - `FinalizeReviewPlan()` no longer forces `bCompleted = true` + - `FinalizeReviewPlan()` now passes the adjusted plan through `NormalizeReviewPlanState()`, so completion is derived from actual terminal entry state instead of being asserted up front + +## Product effect + +Explicit review-run completion is now more truthful: + +- unfinished review work stays represented as open carryover when the review plan still has non-terminal entries +- review-program summary closure no longer drops carryover pressure just because the active run ended +- downstream coach memory, coach brief derivation, and dashboard-adjacent state keep seeing the correct post-review pressure +- fully exhausted review plans still close normally through the existing normalizer + +## Acceptance criteria + +- explicit review-run completion no longer force-closes review plans that still contain non-terminal entries +- unfinished review carryover remains visible in repository-derived review-program summary state +- post-review coach feedback no longer loses pressure from artificially closed review plans +- full product build succeeds + +## Validation checklist + +1. build `UnrealHyperTwist.sln` / `UnrealHyperTwistEditor` +2. confirm `FinalizeReviewPlan()` no longer sets `bCompleted = true` unconditionally +3. confirm finalization now routes through `NormalizeReviewPlanState()` +4. confirm open review carryover can survive explicit run completion into repository-derived summary state +5. confirm no broader queue or review-policy packet is reopened + +That is the packet.