LabKit MATLAB Workbench

history

Runtime-owned session defaults across App families

id: LK-20260716-runtime-owned-session-defaults
date: 2026-07-16
sequence: 116
type: refactor
compatibility: compatible
component: `labkit.ui` | `7.4.3 -> 7.4.4`
component: `labkit_DICPostprocess_app` | `1.4.3 -> 1.4.4`
component: `labkit_DICPreprocess_app` | `1.5.4 -> 1.5.5`
component: `labkit_GaitAnalysis_app` | `2.0.4 -> 2.0.5`
component: `labkit_BatchImageCrop_app` | `1.7.3 -> 1.7.4`
component: `labkit_CurvatureMeasurement_app` | `1.4.3 -> 1.4.4`
component: `labkit_FLIRThermal_app` | `1.4.3 -> 1.4.4`
component: `labkit_FocusStack_app` | `1.5.2 -> 1.5.3`
component: `labkit_ImageEnhance_app` | `1.6.3 -> 1.6.4`
component: `labkit_ImageMatch_app` | `1.6.3 -> 1.6.4`
component: `labkit_VideoMarker_app` | `1.5.2 -> 1.5.3`
component: `labkit_FigureStudio_app` | `0.2.5 -> 0.2.6`
component: `labkit_NerveResponseAnalysis_app` | `1.4.3 -> 1.4.4`
component: `labkit_ResponseReviewStats_app` | `1.4.3 -> 1.4.4`
component: `labkit_RHSPreview_app` | `1.4.3 -> 1.4.4`
component: `labkit_ECGPrint_app` | `1.4.3 -> 1.4.4`
scope: Runtime V2 session construction
scope: App maintenance cost

Context

Runtime V2 already adds the canonical selection, workflow, view, and cache session buckets after an App factory returns. Its workflow service also creates logLines on the first log operation. Fifteen App factories still repeated empty buckets or initialized that framework-owned log, making their state declarations longer and obscuring which transient fields were genuinely App-specific.

Decision and rationale

Treat canonical session shape and workflow-log initialization as Runtime control-plane responsibilities. An App session factory now returns only the selection, workflow, view, and cache fields that express its own workflow. This preserves explicit App state while removing framework boilerplate.

Changes

User and data impact

There is no workflow, scientific, persistence, or saved-data change. Runtime normalization produces the same complete in-memory session before validation, presentation, or the first callback. Existing project files remain compatible.

Compatibility and migration

The change is source-compatible within Runtime V2 and requires no project payload migration. Direct tests of an App's raw session factory should inspect only App-owned fields; tests that need canonical empty buckets should create state through Runtime.

Validation

The fleet structure guard covers every public App factory. Focused App unit and hidden-GUI suites verify restored state, initial presentation, workflow logs, and representative source-backed sessions across the affected families.

Evidence

Known limitations and follow-up

Most factories still perform necessary source decoding or reconstruction. They should not be removed merely to reduce file count. Further simplification requires evidence that a repeated reconstruction pattern is domain-neutral and belongs behind a stable Runtime service.