# HyperTwist Phase 4 template launch provenance packet

Created on `2026-05-06`

Status:

- first-party HyperTwist packet
- bounded Phase `4` dashboard template provenance slice

## Purpose

This packet captures and surfaces template-launch provenance for completed runs started through the dashboard template lane.

The open tasks were:

- remember which active session template launched a completed dashboard run
- retain the template `TemplateId`, `TemplateKind`, and `SourceReviewPlanId` alongside the run recap
- add a first-party dashboard history surface so repeated template launches can be audited

It is not:

- a repository schema migration packet
- a template browser or template editing packet
- a new run-restart or replay semantics packet
- a broader dashboard history redesign

## Scope

Bounded lane:

- capture active template launch context when `StartPreferredActiveSessionTemplateRun()` succeeds
- carry that context through `SyncRetainedRunRecap()` when the run completes or aborts
- record retained template-launch history snapshots with run outcome fields
- append template provenance to the run recap display when the displayed recap came from a template-backed launch
- add a dedicated `[Template Launch History]` section with simple previous/next navigation

Out of scope:

- changing repository persistence for run summaries
- altering template selection priority
- changing method-drill follow-up weighting logic
- changing coach handoff recommendation rules

## Why this was the right next packet

The previous packet made the template-backed launch lane visible and clickable from the first-party dashboard.

That still left one practical gap:

- once a template-backed run finished, the recap no longer explained which template produced it
- repeated template launches had no retained audit trail on the dashboard itself
- review-preferring template outcomes could not be compared from the same first-party surface that launched them

The next honest move was therefore:

- capture template provenance at launch time
- retain it only through the dashboard recap/history path
- and keep the change narrowly scoped to first-party dashboard state and presentation

## What landed

Primary code changes:

- `UnrealHyperTwist/Source/UnrealHyperTwist/Public/HyperTwistTraining/HyperTwistCoachDashboardWidget.h`
  - added retained template-launch history entry shape and selected-history index
  - added active/retained template launch context members
  - added dashboard text/button members and handlers for a new template-launch history section
- `UnrealHyperTwist/Source/UnrealHyperTwist/Private/HyperTwistTraining/HyperTwistCoachDashboardWidget.cpp`
  - captures template launch context when the preferred dashboard template run starts
  - records template launch provenance when the matching run recap completes or aborts
  - retains up to sixteen template launch history snapshots
  - appends template provenance into the displayed run recap when applicable
  - adds a `[Template Launch History]` status/detail section with previous/next navigation

## Product effect

The first-party dashboard now keeps template-backed run provenance attached to the run outcome:

- run recap shows the template id, template kind, and source review-plan id for matching template launches
- the dashboard retains a small history of completed template-backed runs and their outcome summaries
- operators can page through recent template launches without leaving the dashboard
- review-preferring template runs are now auditable from launch through recap on the same first-party surface

## Acceptance criteria

- successful dashboard template launches capture template provenance
- completed or aborted template-backed runs retain that provenance in recap state
- dashboard shows template provenance in run recap when the displayed run came from a template launch
- dashboard exposes retained template-launch history with previous/next navigation
- full product build succeeds

## Validation checklist

1. build `UnrealHyperTwist.sln` / `UnrealHyperTwistEditor`
2. launch a run through the dashboard template button
3. complete or abort the run and confirm run recap shows template provenance
4. confirm the dashboard `[Template Launch History]` section records the completed run

That is the packet.
