Skip to content

Block layout update - #12

Merged
mzueva merged 5 commits into
mainfrom
mzueva/MILAB-6808-dms-antibody
Aug 31, 2026
Merged

mzueva merged 5 commits into
mainfrom
mzueva/MILAB-6808-dms-antibody

Conversation

@mzueva

@mzueva mzueva commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Update block to the latest layout (kind package)

Greptile Summary

The PR migrates the repository to the latest block layout, introduces the mandatory kind package, updates SDK integrations, and refreshes build and release tooling.

  • Block kind — the typed identity and initialization contract for the block; newly added with optional frConfThresh and cdrConfThresh parameters, runtime validation, and a generated kind manifest.
  • Block parameters (BlockParams) — template-portable settings used when creating a block; introduced to carry only the two confidence thresholds while excluding project-bound dataset and view state.
  • Data model — persisted block state and migration lifecycle; now associates the kind with DataModelBuilder, initializes thresholds from kind parameters, and exports them through templateParams.
  • Block pointer — a portable reference to the packaged block; replaces the former dev-v2 blockSpec with a from-pack-v2 pointer derived from the facade URL.
  • Block facade — the package’s public runtime and type surface; moved into block/src/index.ts, exports inferred contracts and the block pointer, and is built into dist.
  • Scores table — the model output combining liability scores with compatible enrichment columns; migrated from ArrayColumnProvider to DataColumn.fromColumn, with separate primary and enrichment collections and selector-based visibility rules.
  • Build variants — environment-controlled software packaging modes; new development and release scripts select channel, artifact variant, and local or remote build location.
  • Workspace delivery graph — package build ordering, caching, and publication boundaries; expanded for the kind package, new SDK versions, facade outputs, and updated software packaging.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete blocking or independently actionable defects identified in the changed paths.

The kind parameters, model initialization, facade pointer, table API migration, package contents, and build ordering remain internally aligned across the reviewed changes.

Important Files Changed

Filename Overview
kind/src/index.ts Adds the block identity and validated, template-portable confidence-threshold parameter contract.
model/src/index.ts Wires the kind into model initialization and template export while migrating the scores table to the upgraded SDK API.
block/src/index.ts Introduces the dependency-free facade contracts and URL-based from-pack-v2 block pointer.
block/package.json Changes the published package to ship the compiled facade and block-pack with updated build and check commands.
package.json Replaces the generic build entrypoints with explicit development and release build variants.
turbo.json Updates build environment inputs, pass-through credentials, and generated output boundaries for the new packaging flow.
.github/workflows/build.yaml Moves CI to the designated runner and aligns validation and publication with the new development and release scripts.
software/package.json Migrates software artifact construction from package-builder to block-tools.
test/src/wf.test.ts Updates the block-load integration test to consume the new block pointer.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Template[Project template] --> Kind[Kind: identity and BlockParams]
  Kind --> Model[Data model initialization]
  Model --> Workflow[Workflow arguments]
  Workflow --> Software[Liability analysis software]
  Software --> Results[Typed score columns]
  Results --> Model
  Model --> UI[Results UI]
  Kind --> Pack[block-pack]
  Model --> Pack
  Workflow --> Pack
  UI --> Pack
  Facade[Block facade] --> Pointer[from-pack-v2 BlockPointer]
  Pointer --> Pack
Loading

Reviews (1): Last reviewed commit: "MILAB-6808: add changeset for the templa..." | Re-trigger Greptile

Context used (5)

mzueva added 4 commits August 27, 2026 13:15
Every block must now declare exactly one kind — block-tools 2.14 hard-fails a
kind-less block on `structure check`. The kind carries the block's identity
(`{name}@{version}`, read from its own `package.json`) and its init-params
contract: the fields a project template supplies to seed a new instance.

The contract is the two confidence gates, `frConfThresh` and `cdrConfThresh`.
They decide which residues are trusted enough to score, so they are the only
fields that change what the block computes. Both are optional so a template can
seed either one alone.

Excluded by construction: `dataset` is an anchor-bound `DatasetSelection` whose
meaning depends on the anchor map of the project that made it, so it cannot
travel in a template; `tableState` is view state; `customBlockLabel` is a label
typed over a derived default.

`parseInitializationParams` checks each gate as a finite number and stops there.
The UI offers a bounded range, but encoding that range here would make the kind
refuse a file this block itself exported the day the range changes.
Pure `block-tools structure refresh` output — no hand edits. Ran the canonical
flow: `refresh --update-deps-only`, install, `refresh`, install, `fmt`.

SDK bumps: model / ui-vue 1.79.14 to 1.83.x, workflow-tengo 6.6.3 to 6.8.3,
tengo-builder 4.0.8 to 4.0.23, ts-builder 1.5.2 to 1.7.1, package-builder 3.13.0
to 3.15.0. block-tools was already at the latest 2.14.3.

The refresh reshaped `block/` into the slim facade: `dependencies` is now empty,
the whole block bundles into `dist/` plus `block-pack/`, and the old
`index.js` / `index.d.ts` pair is replaced by a generated `src/` that exports a
from-pack-v2 `BlockPointer`. It also canonicalized the new kind package's
tsconfig and lint config, and wired the kind in on both sides — a `workspace:*`
dependency from the model and a direct devDep from the facade.

The root build scripts were renamed: `build:dev` is now `build:dev-local`, and
the `PL_PKG_DEV` env var is replaced by `PL_BUILD_CHANNEL` / `PL_BUILD_VARIANT`
/ `PL_BUILD_LOCATION`.

`structure check` is a fixpoint on this tree.
The model now declares its kind: `new DataModelBuilder({ kind })` and
`BlockModelV3.create({ dataModel, kind })`. `init` consumes the contract —
`params?.frConfThresh ?? 4.0` and `params?.cdrConfThresh ?? 6.0`, so a block
created outside a template still gets its defaults. `.templateParams` projects
the same two fields back out, which makes export and apply inverses. That
projection is mandatory: `done()` throws without it.

Author-code fixes the SDK upgrade required:

- `ArrayColumnProvider` is gone from `@platforma-sdk/model`. The scores table
  builds its recipes with `DataColumn.fromColumn` instead, and passes score and
  enrichment columns through the separate `primaryColumns` / `columns` fields
  that `createPlDataTableV3` now takes — the old single `columns` array of
  `{ column, isPrimary }` pairs is no longer accepted.
- `ColumnVisibilityRule.match` takes a selector object, not a predicate. The two
  mode-specific flag rules now match by `{ name: "..." }`.
- The test imported the facade's old `blockSpec`, which the slim facade replaced
  with a from-pack-v2 `BlockPointer`.
Lists the `kind` package alongside model / workflow / software / ui / facade.
Private means "not published", not "not versioned": with no `privatePackages`
key in `.changeset/config.json` changesets defaults to `{ version: true }`, and
the kind ships author-written code (`parseInitializationParams`) that changes
on its own. Verified with `changeset status` — all six bump at patch.
@mzueva
mzueva requested a review from AStaroverov August 27, 2026 11:35
The catalog sat on ui-vue 1.83.1, the publish that dropped
dist/components/*.vue.d.ts. Nothing here resolves those files today, so the
build was unaffected, but 1.83.3 restores them and is what `structure refresh
--update-deps-only` derives. It also moves ts-builder to 1.7.2.
@mzueva
mzueva merged commit 4781154 into main Aug 31, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants