Block layout update - #12
Merged
Merged
Conversation
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.
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.
AStaroverov
approved these changes
Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
frConfThreshandcdrConfThreshparameters, runtime validation, and a generated kind manifest.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.DataModelBuilder, initializes thresholds from kind parameters, and exports them throughtemplateParams.dev-v2blockSpecwith afrom-pack-v2pointer derived from the facade URL.block/src/index.ts, exports inferred contracts and the block pointer, and is built intodist.ArrayColumnProvidertoDataColumn.fromColumn, with separate primary and enrichment collections and selector-based visibility rules.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
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 --> PackReviews (1): Last reviewed commit: "MILAB-6808: add changeset for the templa..." | Re-trigger Greptile
Context used (5)