LabKit MATLAB Workbench

history

App SDK explicit contract replaces the retired UI runtime

id: LK-20260719-ui-explicit-contract-migration
date: 2026-07-19
sequence: 138
type: refactor
compatibility: breaking
component: `labkit.app` | `new -> 1.0.0`
component: `labkit_DICPostprocess_app` | `1.4.7 -> 1.5.0`
component: `labkit_DICPreprocess_app` | `1.5.8 -> 1.6.0`
component: `labkit_ChronoOverlay_app` | `1.4.7 -> 1.5.0`
component: `labkit_CIC_app` | `1.4.7 -> 1.5.0`
component: `labkit_CSC_app` | `1.4.8 -> 1.5.0`
component: `labkit_EIS_app` | `1.4.7 -> 1.5.0`
component: `labkit_VTResistance_app` | `1.4.7 -> 1.5.0`
component: `labkit_GaitAnalysis_app` | `2.0.8 -> 2.1.0`
component: `labkit_BatchImageCrop_app` | `1.7.7 -> 1.8.0`
component: `labkit_CurvatureMeasurement_app` | `1.4.6 -> 1.5.0`
component: `labkit_FLIRThermal_app` | `1.4.8 -> 1.5.0`
component: `labkit_FocusStack_app` | `1.5.6 -> 1.6.0`
component: `labkit_ImageEnhance_app` | `1.6.7 -> 1.7.0`
component: `labkit_ImageMatch_app` | `1.6.8 -> 1.7.0`
component: `labkit_VideoMarker_app` | `1.5.7 -> 1.6.0`
component: `labkit_FigureStudio_app` | `0.2.9 -> 0.3.0`
component: `labkit_NerveResponseAnalysis_app` | `1.4.8 -> 1.5.0`
component: `labkit_ResponseReviewStats_app` | `1.4.7 -> 1.5.0`
component: `labkit_RHSPreview_app` | `1.4.6 -> 1.5.0`
component: `labkit_TTestWizard_app` | `1.0.1 -> 1.1.0`
component: `labkit_ECGPrint_app` | `1.4.6 -> 1.5.0`
scope: App Framework
scope: DIC
scope: Electrochem
scope: Gait
scope: Image Measurement
scope: LabKit Core
scope: Neurophysiology
scope: Statistics
scope: Wearable
scope: Project persistence
scope: Result provenance

Context

The retired UI runtime removed substantial per-App lifecycle code, but Apps still registered callback tables, repeated bound values in presenters, authored standard file add/remove/clear behavior, and depended on nested event/service structs. A replacement SDK kernel had already established immutable semantic values, pre-GUI validation, transactional state/presentation commits, project documents, result manifests, resources, and portable sources. The migration then had to restore the complete behavior and visual contract of every tracked App before the retired production facade could be deleted.

Decision and rationale

Create labkit.app as the stable SDK rather than misnaming the expanded contract labkit.ui or adapting it back to Runtime V2 transport structs. Keep the public root small, partition authoring by capability, and concentrate complexity in a paved path: direct-callback layout.* nodes, strict bindings, runtime-completed view.Snapshot values, standard file lifecycle, fixed CreateSession(project,context), and private native adapters.

Migrate all 21 tracked Apps through capability waves, treating their previous controls, tabs, layout proportions, interactions, project behavior, results, debug samples, and workflow wording as product contracts rather than reducing the task to launch compatibility.

Changes

User and data impact

Chrono Overlay retains its input formats, pulse-gap alignment, plot meanings, parameter defaults, CSV table, and version-2 project payload. T-Test Wizard retains its source formats, group/test calculations, plot meaning, two CSV exports, and version-2 project payload. VT Resistance retains its pulse detection, resistance calculations, plot semantics, CSV schema, and version-1 project payload while recomputing the decoded batch under shared settings. Gait Analysis retains its Video Marker payload contract, project migrations, step segmentation, gait metrics, CSV set, and version-3 project payload. File identities and portable paths remain runtime-owned. DIC Preprocess retains its rigid registration, common crop, mask editing, image/mask exports, and version-1 project payload. Batch Image Crop retains duplicate tasks per source, fixed-pixel and physical crops, rotation/padding, scale calibration, scale-bar placement, image/CSV exports, and its version-2 payload. Existing payload migrations remain App-owned.

The other 15 Apps retain their documented source formats, scientific calculations, units, thresholds, project payload versions, export schemas, and result meanings. Their product versions advance once from the main baseline to identify the new App SDK source contract and restored complete UI behavior. No project payload version was increased merely because the UI framework changed.

Compatibility and migration

labkit.app 1 is a source-breaking replacement contract for App definitions, presenters, callbacks, events, and interactions. Every tracked App migrated before the retired labkit.ui boundary was deleted; there is no runtime adapter or dual authoring surface. Public App entrypoint commands remain stable. Project documents retain their format and App payload versions independently of the facade transition.

Validation

Focused headless tests cover strict values, transactional runtime behavior, project save/restore, authoring defaults, and Chrono calculations/exports. Hidden GUI tests cover native semantic construction, typed control and table callbacks, bound side effects, standard file lifecycle, transient session rebuild, two-axis rendering, viewport preservation, renderer rollback, Chrono export, and project restore. VT Resistance focused tests cover resistance calculations, CSV compatibility, native layout, shared batch recomputation, two-axis rendering, result packaging, and project restore. Gait focused tests cover project migration, pose decoding, scientific calculations, CSV compatibility, typed table navigation, three-axis rendering, folder selection, result packaging, and project restore. DIC Preprocess focused tests cover project state, image loading, edit replay, registration/crop/mask helpers, export manifests, native two-axis layout, paired-anchor alignment, and managed crop interaction. Framework regression tests cover cell-valued event payloads and native multi-axis interaction bridging. Batch Image Crop focused tests cover crop geometry, padding, physical scaling, project migration, duplicate tasks, output planning/writes, native semantic layout, current-center editing, and standard result manifests. Focused framework and App tests additionally cover all 21 semantic layouts, typed events, managed interactions, project migration/recovery, result writing, synthetic sample packs, diagnostics, resource cleanup, window titles, startup success/failure, close behavior, and native adapter reconciliation.

Evidence

Known limitations and follow-up

Automated GUI evidence does not replace developer-led validation of native dialogs, editable-table feel, pointer interaction, long-lived resource use, representative exports, visual quality, or scientific workflow suitability. That interactive validation remains a release input for the exact integrated commit.