Migrate repertoire-diversity onto structurer + BlockModelV3#49
Conversation
… upgrade Adopt the tool-managed block layout (oxlint/oxfmt, ts-builder, regenerated tsconfig/turbo/index/package.json across model, ui, workflow, block, software) and the forced full SDK upgrade: model/ui-vue 1.64.0 -> 1.79.14, tengo-builder 2.5.29 -> 4.0.8 (2->4), workflow-tengo -> 6.6.3, block-tools -> 2.11.0. Remove orphaned test scaffolding: the structurer drops vitest from model/ui devDeps (canonical structured blocks centralize tests in a test/ package), leaving the model/ui 'test': 'vitest' scripts and vitest.config.mts files dangling — the block has zero test files. Drop the dead scripts and configs. CI workflows left unchanged from main (structurer drift — app-name 'Repertoire Diversity' -> 'Repertoire Diversity 2', test:false->true, a turborepo S3 bucket secret rename, Slack reordering — is unrelated).
Replace the V1 model (BlockModel + withArgs/withUiState/argsValid) with BlockModelV3 + a DataModelBuilder: - model/src/types.ts: unified BlockData (abundanceRef, MetricUI[] metrics, block labels, table/graph view state), workflow-facing BlockArgs (abundanceRef + stripped Metric[]), and legacy V1 on-disk shapes. - model/src/dataModel.ts: .upgradeLegacy folds V1 args (refData + metrics + labels) and uiState (MetricUI[] + table/graph state) into unified data; .init seeds the five default metrics for fresh projects. - index.ts: .args projects abundanceRef + convertMetricsUiToArgs(data.metrics) and throws on missing input / untyped metric (replaces argsValid + .done(2)). ctx.uiState/ctx.args reads -> ctx.data. abundanceRef is required in BlockArgs. - UI: defineApp -> defineAppV3; app.model.args/ui.* -> app.model.data.*. Delete the debounced ui.metrics -> args.metrics sync watcher (the args lambda does the projection now). The block-label watchEffect stays (tolerated exception), repointed to data. SDK-upgrade fallout fix: guard SettingsModal's isEmpty against the now-optional visibleTableHandle (PTableHandle | undefined since model 1.79).
There was a problem hiding this comment.
Code Review
This pull request migrates the repository to the BlockModelV3 and block-tools structurer, upgrading the SDK packages and moving UI bindings to app.model.data. It also reorganizes the workspace configuration, updates build and linting scripts to use ts-builder and oxlint/oxfmt, and simplifies state synchronization. Feedback on the changes highlights two potential runtime errors: a possible crash in DiversityGraph.vue if the diversity column is not found in pcols, and a potential TypeError in SettingsModal.vue if app.model.outputs.pt.value is undefined when accessing visibleTableHandle.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
… metric loss - converters.ts imports Metric/MetricUI from ./types (not ./index), removing the type-only import cycle now that the types live in ./types. - upgradeLegacy: if a V1 project's uiState.metrics is absent, recover the metric set from args.metrics (with generated ids) instead of silently dropping to the hardcoded defaults; defaults only when neither source exists.
Migrates
repertoire-diversityonto the block-tools structurer and from V1 to BlockModelV3.Commits
chore:structurer refresh + SDK upgrade — tool-managed layout (oxlint/oxfmt, ts-builder, regenerated configs across model, ui, workflow, block, software). Full SDK upgrade: model/ui-vue 1.64.0→1.79.14, tengo-builder 2.5.29→4.0.8(2→4), workflow-tengo→6.6.3, block-tools→2.11.0. Removes orphaned test scaffolding (the structurer dropsvitestfrom model/ui devDeps — canonical structured blocks centralize tests in atest/package — leaving danglingtest: "vitest"scripts +vitest.config.mtsfiles with zero test files behind them).feat:BlockModelV3 model — see below.chore:changeset.V3 model design
abundanceRefargs(required)metricsargsviaconvertMetricsUiToArgs(data.metrics)Metric[]is projected from the editableMetricUI[]metrics(MetricUI[]),tableState,graphStatedatadefaultBlockLabel,customBlockLabeldatadataholds the editableMetricUI[](withid/isExpanded); the args lambda strips it toMetric[]. The debouncedui.metrics → args.metricssync watcher is deleted — the projection lambda replaces it. Editing view state / labels no longer stales the block; only the abundance input and metric set do..upgradeLegacyfolds V1args+uiStateinto unifieddata, preserving persisted projects.watchEffect(tolerated SDK exception) stays, repointed todata.Fixes surfaced by the SDK upgrade
SettingsModal'sisEmptyagainst the now-optionalvisibleTableHandle(PTableHandle | undefinedsince model 1.79).Deliberately not adopted
The structurer rewrote the CI workflows with unrelated changes — app-name
'Repertoire Diversity'→'Repertoire Diversity 2',test:false→true(no tests), a turborepo S3-bucket secret rename, Slack reordering. Both.github/workflows/*.yamlare left identical tomain.Verification
pnpm build:dev+check(tsc + oxlint + oxfmt) +pnpm testall green (turbo 8/8). Changeset validated.Not done: runtime legacy-upgrade check against a saved V1 project (needs a backend) — recommended before merge.
Greptile Summary
This PR migrates
repertoire-diversityfromBlockModelV1 toBlockModelV3, replacing the separateargs/uiStatechannels with a unifieddatamodel, and upgrades the full SDK stack (model/ui-vue 1.64.0→1.79.14, tengo-builder 2.5.29→4.0.8, workflow-tengo 5.23.0→6.6.3, block-tools 2.7.25→2.11.0). A.upgradeLegacypath folds the V1 on-diskargs+uiStateinto the newdatashape to preserve persisted projects.BlockModelV3+DataModelBuilder:BlockArgsis now projected fromBlockDatavia an args lambda (convertMetricsUiToArgs), removing the debouncedui.metrics → args.metricswatcher; editing labels or view state no longer stales the block, onlyabundanceRefandmetricsdo.SettingsModalguard:visibleTableHandleis now checked forundefinedbefore being passed topFrameDriver.getShape, fixing a crash on the SDK-1.79 API change where the handle became optional.lint/type-checktasks replaced byfmt/check;pl-tengo checksplit into its owncheckscript; the CI workflow files are intentionally left unchanged frommain.Confidence Score: 4/5
Safe to merge with awareness that the runtime legacy-upgrade path has not been validated against a real saved V1 project.
The structural migration is clean and the build/check/test pipeline is reportedly green. The main open item called out by the author themselves — a runtime check against a persisted V1 project — is still pending. The
upgradeLegacysilently discardsargs.metricswhenuiStateis absent, which could reset a user's metric configuration on first open. The pre-existinggetIndex(-1)crash in the graph view is also left unguarded. Neither is a showstopper for most scenarios, but the legacy-upgrade gap is worth confirming before shipping to users with saved V1 projects.model/src/dataModel.ts (upgradeLegacy path) and ui/src/pages/DiversityGraph.vue (unchecked array access) deserve a second look before shipping to users with existing V1 projects.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD subgraph data["BlockData (persisted)"] AR[abundanceRef] ME["metrics: MetricUI[]"] DBL[defaultBlockLabel] CBL[customBlockLabel] TS[tableState] GS[graphState] end subgraph argsLambda["args lambda (BlockModelV3)"] CHECK{abundanceRef\ndefined?} CONV[convertMetricsUiToArgs] THROW[throw Error] end subgraph args["BlockArgs → Workflow"] WF_AR["abundanceRef: PlRef"] WF_ME["metrics: Metric[]"] end subgraph outputs["Model Outputs"] OPT[abundanceOptions] PT["pt: PTable"] PF["pf: PFrame"] end subgraph uiwatcher["UI watchEffect"] WE[syncDefaultBlockLabel] end AR --> CHECK ME --> CONV CHECK -- undefined --> THROW CHECK -- present --> WF_AR CONV --> WF_ME OPT --> WE WE -->|writes| DBL TS -->|v-model| PT GS -->|v-model| PF style THROW fill:#f88,color:#000 style data fill:#e8f4fd,color:#000 style args fill:#d4edda,color:#000%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD subgraph data["BlockData (persisted)"] AR[abundanceRef] ME["metrics: MetricUI[]"] DBL[defaultBlockLabel] CBL[customBlockLabel] TS[tableState] GS[graphState] end subgraph argsLambda["args lambda (BlockModelV3)"] CHECK{abundanceRef\ndefined?} CONV[convertMetricsUiToArgs] THROW[throw Error] end subgraph args["BlockArgs → Workflow"] WF_AR["abundanceRef: PlRef"] WF_ME["metrics: Metric[]"] end subgraph outputs["Model Outputs"] OPT[abundanceOptions] PT["pt: PTable"] PF["pf: PFrame"] end subgraph uiwatcher["UI watchEffect"] WE[syncDefaultBlockLabel] end AR --> CHECK ME --> CONV CHECK -- undefined --> THROW CHECK -- present --> WF_AR CONV --> WF_ME OPT --> WE WE -->|writes| DBL TS -->|v-model| PT GS -->|v-model| PF style THROW fill:#f88,color:#000 style data fill:#e8f4fd,color:#000 style args fill:#d4edda,color:#000Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "chore: add changeset for structurer + V3..." | Re-trigger Greptile
Context used: