Skip to content

Commit 4781154

Browse files
authored
Merge pull request #12 from platforma-open/mzueva/MILAB-6808-dms-antibody
Block layout update
2 parents 949c735 + bc27689 commit 4781154

27 files changed

Lines changed: 1525 additions & 1035 deletions
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
'@platforma-open/milaboratories.3d-structure-based-liabilities.kind': patch
3+
'@platforma-open/milaboratories.3d-structure-based-liabilities.model': patch
4+
'@platforma-open/milaboratories.3d-structure-based-liabilities.workflow': patch
5+
'@platforma-open/milaboratories.3d-structure-based-liabilities.software': patch
6+
'@platforma-open/milaboratories.3d-structure-based-liabilities.ui': patch
7+
'@platforma-open/milaboratories.3d-structure-based-liabilities': patch
8+
---
9+
10+
Migrate to the latest block template and add the mandatory kind package
11+
12+
Refreshed onto block-tools 2.14.3 via `upgrade-sdk`, and added the `kind/`
13+
package every block must now declare. The kind carries the block's identity
14+
(`{name}@{version}`, read from its own `package.json`) and its init-params
15+
contract. The refresh also reshaped `block/` into the slim facade, which
16+
publishes the whole block from one dependency-free package.
17+
18+
`BlockParams` is the two confidence gates, `frConfThresh` and `cdrConfThresh`.
19+
They decide which residues are trusted enough to score, so they are the only
20+
fields that change what the block computes. Both are optional, so a project
21+
template can seed either one alone and the model's `init` keeps a default
22+
behind each. `.templateParams` projects the same two back, so exporting a block
23+
to a template and initializing one from it are inverses. Everything else is
24+
excluded by construction: `dataset` is an anchor-bound `DatasetSelection` that
25+
cannot travel between projects, `tableState` is view state, and
26+
`customBlockLabel` is a label typed over a derived default.
27+
28+
Author-code fixes the SDK upgrade required:
29+
30+
- `ArrayColumnProvider` is gone from `@platforma-sdk/model`. The scores table
31+
now builds its recipes with `DataColumn.fromColumn`, and passes primary and
32+
enrichment columns through the separate `primaryColumns` / `columns` fields
33+
that `createPlDataTableV3` now takes.
34+
- Column visibility rules match by selector object (`{ name: "..." }`) instead
35+
of by predicate function.
36+
- The test used the facade's old `blockSpec` export, which the slim facade
37+
replaced with a from-pack-v2 `BlockPointer`.

.github/workflows/build.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
workflow_dispatch: {}
1212
jobs:
1313
init:
14-
runs-on: ubuntu-latest
14+
runs-on: hz-ubuntu-dind
1515
steps:
1616
- uses: milaboratory/github-ci/actions/context/init@v4
1717
with:
@@ -22,10 +22,12 @@ jobs:
2222
- init
2323
uses: milaboratory/github-ci/.github/workflows/node-simple-pnpm.yaml@v4
2424
with:
25-
app-name: 'Block: 3d Structure-Based Liabilities'
25+
app-name: 'Block: 3d Structure Based Liabilities'
2626
app-name-slug: 'block-3d-structure-based-liabilities'
2727
node-version: '22.x'
28-
build-script-name: 'build'
28+
gha-runner-label: hz-ubuntu-dind
29+
build-script-name: 'build:dev-local'
30+
build-before-publish-script-name: 'build:release'
2931
pnpm-recursive-build: false
3032

3133
test: true
@@ -37,6 +39,11 @@ jobs:
3739
package-path: 'block'
3840
create-tag: 'true'
3941

42+
# Require the published `block` package to be bumped by a changeset on
43+
# PRs (empty changeset or the `skip-changelog` label waives it). Needs
44+
# the input to exist on the pinned `@v4` reusable workflow.
45+
require-package-path-bump: true
46+
4047
npmrc-config: |
4148
{
4249
"registries": {
@@ -56,6 +63,15 @@ jobs:
5663
5764
"AWS_CI_IAM_MONOREPO_SIMPLE_ROLE": ${{ toJSON(secrets.AWS_CI_IAM_MONOREPO_SIMPLE_ROLE) }},
5865
"AWS_CI_TURBOREPO_S3_BUCKET": ${{ toJSON(secrets.AWS_CI_TURBOREPO_S3_BUCKET) }},
66+
67+
"HZ_CI_TURBO_S3_BUCKET": ${{ toJSON(vars.HZ_CI_TURBO_S3_BUCKET) }},
68+
"HZ_CI_TURBO_S3_ENDPOINT": ${{ toJSON(vars.HZ_CI_TURBO_S3_ENDPOINT) }},
69+
"HZ_CI_TURBO_S3_REGION": ${{ toJSON(vars.HZ_CI_TURBO_S3_REGION) }},
70+
"HZ_CI_TURBO_S3_ACCESS_KEY": ${{ toJSON(secrets.HZ_CI_TURBO_S3_ACCESS_KEY) }},
71+
"HZ_CI_TURBO_S3_SECRET_KEY": ${{ toJSON(secrets.HZ_CI_TURBO_S3_SECRET_KEY) }},
72+
"HZ_CI_CACHE_S3_ACCESS_KEY": ${{ toJSON(secrets.HZ_CI_CACHE_S3_ACCESS_KEY) }},
73+
"HZ_CI_CACHE_S3_SECRET_KEY": ${{ toJSON(secrets.HZ_CI_CACHE_S3_SECRET_KEY) }},
74+
5975
"PL_REGISTRY_PLATFORMA_OPEN_UPLOAD_URL": ${{ toJSON(secrets.PL_REGISTRY_PLOPEN_UPLOAD_URL) }},
6076
"QUAY_USERNAME": ${{ toJSON(secrets.QUAY_USERNAME) }},
6177
"QUAY_ROBOT_TOKEN": ${{ toJSON(secrets.QUAY_ROBOT_TOKEN) }} }

.structure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":1}
1+
{"version":2}

block/index.d.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

block/index.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

block/package.json

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,39 @@
22
"name": "@platforma-open/milaboratories.3d-structure-based-liabilities",
33
"version": "1.3.0",
44
"files": [
5-
"index.d.ts",
6-
"index.js"
5+
"dist",
6+
"block-pack"
77
],
8+
"type": "module",
9+
"main": "./dist/index.js",
10+
"module": "./dist/index.js",
11+
"types": "./dist/index.d.ts",
12+
"exports": {
13+
".": {
14+
"sources": "./src/index.ts",
15+
"types": "./dist/index.d.ts",
16+
"default": "./dist/index.js"
17+
}
18+
},
819
"scripts": {
9-
"build": "shx rm -rf ./block-pack && block-tools pack",
20+
"build": "ts-builder build --target block-facade && block-tools pack",
1021
"prepublishOnly": "block-tools publish -r s3://milab-euce1-prod-pkgs-s3-block-registry/pub/releases/?region=eu-central-1 --registry-serve-url https://blocks.pl-open.science",
11-
"do-pack": "shx rm -f *.tgz && block-tools pack && pnpm pack && shx mv *.tgz package.tgz",
12-
"mark-stable": "block-tools mark-stable -r 's3://milab-euce1-prod-pkgs-s3-block-registry/pub/releases/?region=eu-central-1'"
22+
"do-pack": "shx rm -f package.tgz && pnpm pack && shx mv *.tgz package.tgz",
23+
"mark-stable": "block-tools mark-stable -r 's3://milab-euce1-prod-pkgs-s3-block-registry/pub/releases/?region=eu-central-1'",
24+
"check": "ts-builder type-check --target block-facade"
1325
},
14-
"dependencies": {
26+
"dependencies": {},
27+
"devDependencies": {
28+
"@milaboratories/ts-builder": "catalog:",
29+
"@milaboratories/ts-configs": "catalog:",
30+
"@platforma-open/milaboratories.3d-structure-based-liabilities.kind": "workspace:*",
1531
"@platforma-open/milaboratories.3d-structure-based-liabilities.model": "workspace:*",
1632
"@platforma-open/milaboratories.3d-structure-based-liabilities.ui": "workspace:*",
1733
"@platforma-open/milaboratories.3d-structure-based-liabilities.workflow": "workspace:*",
18-
"@platforma-sdk/model": "catalog:"
19-
},
20-
"devDependencies": {
2134
"@platforma-sdk/block-tools": "catalog:",
22-
"shx": "catalog:"
35+
"@platforma-sdk/model": "catalog:",
36+
"shx": "catalog:",
37+
"typescript": "catalog:"
2338
},
2439
"packageManager": "pnpm@9.12.0",
2540
"block": {

block/src/AGENTS.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// This file is managed by `block-tools structure`. Do not edit by hand.
2+
// Narrow MCP / AI surface.
3+
4+
export type { BlockContract, BlockOutputs, BlockData } from "./index";
5+
export * from "./agents-extra";

block/src/agents-extra.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Author-owned. `block-tools structure` does not modify this file.
2+
// MCP / AI extension surface. Add types and functions the agent
3+
// surface should expose.
4+
//
5+
// In the future this file will host JS functions the MCP runtime
6+
// can execute. The `.d.ts` declarations stay visible to the agent;
7+
// the JS bodies execute in the MCP code-execution context (the
8+
// agent sees the types but not the implementation).

block/src/block-extra.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Author-owned. `block-tools structure` does not modify this file.
2+
// Add block-specific helper types or values the consumer surface
3+
// should expose. Anything you `export` here flows out via the
4+
// main entry (./index re-exports this file).
5+
//
6+
// Do NOT redefine: BlockContract, BlockOutputs, BlockData,
7+
// BlockPointer, platforma, or the block-named <PascalName>Block*
8+
// aliases — those names come from ./index and `export *` from this
9+
// file would shadow them.

block/src/index.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// This file is managed by `block-tools structure`. Do not edit by hand.
2+
// Author content lives in ./block-extra.ts.
3+
4+
import { platforma } from "@platforma-open/milaboratories.3d-structure-based-liabilities.model";
5+
import {
6+
InferOutputsType,
7+
InferDataType,
8+
InferHrefType,
9+
} from "@platforma-sdk/model";
10+
11+
export { platforma };
12+
13+
export type BlockContract = {
14+
outputs: InferOutputsType<typeof platforma>;
15+
data: InferDataType<typeof platforma>;
16+
href: InferHrefType<typeof platforma>;
17+
};
18+
19+
export type BlockOutputs = BlockContract["outputs"];
20+
export type BlockData = BlockContract["data"];
21+
22+
// import.meta.url is a file: URL (always forward-slash, even on Windows:
23+
// file:///C:/…). We expose URLs, NOT paths — the facade stays dependency-free
24+
// and loadable in minimal engines (e.g. QuickJS), and each consumer converts
25+
// at its own edge with the right tool (fileURLToPath in Node), where Windows
26+
// drive letters / %-encoding / UNC are handled correctly. The bundled entry
27+
// sits one dir under the package root (dist/index.js, or src/index.ts in dev),
28+
// so the root is two URL segments up. The structurer owns this layout —
29+
// consumers read these URLs, they never reconstruct <root>/block-pack.
30+
//
31+
// TypeScript ships `ImportMeta.url` only in the `dom`/`webworker` libs; the
32+
// facade tsconfig is lib-minimal (no `dom`, no `@types/node`) by design. We
33+
// type the one ESM-standard member we use with a local cast rather than a
34+
// `declare global` — a global augmentation would leak into the published
35+
// `dist/index.d.ts` and clash with `@types/node`'s `ImportMeta` in full-Node
36+
// consumers (test packages, the Middle Layer).
37+
const selfUrl = (import.meta as ImportMeta & { url: string }).url;
38+
const dirUrl = selfUrl.slice(0, selfUrl.lastIndexOf("/"));
39+
const rootUrl = dirUrl.slice(0, dirUrl.lastIndexOf("/"));
40+
41+
export const BlockPointer = {
42+
type: "from-pack-v2" as const,
43+
packUrl: rootUrl + "/block-pack",
44+
rootUrl,
45+
} as const;
46+
47+
// Block-named aliases for readable cross-block imports in tests and
48+
// consumer code. Same types / same runtime value as the universal
49+
// names above; the aliases avoid `as`-renames at the import site.
50+
export type _3dStructureBasedLiabilitiesBlockContract = BlockContract;
51+
export type _3dStructureBasedLiabilitiesBlockOutputs = BlockOutputs;
52+
export type _3dStructureBasedLiabilitiesBlockData = BlockData;
53+
export const _3dStructureBasedLiabilitiesBlockPointer = BlockPointer;
54+
55+
export * from "./block-extra";

0 commit comments

Comments
 (0)