Skip to content

Structurer migration#16

Open
mzueva wants to merge 1 commit into
mainfrom
mzueva/structurer-migration
Open

Structurer migration#16
mzueva wants to merge 1 commit into
mainfrom
mzueva/structurer-migration

Conversation

@mzueva

@mzueva mzueva commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR migrates the entire block repository onto the block-tools structure v2 layout, which transfers ownership of tsconfig, oxlint/oxfmt, turbo config, and the block index facade to the tool. It also upgrades the SDK stack (model/ui-vue 1.79.x, workflow-tengo 6.x, tengo-builder 4.0.x, block-tools 2.12.4) and renames the model's exported constant from modelplatforma to match the canonical facade contract.

  • Model rename: export const modelexport const platforma in model/src/index.ts, with all consumers (ui/src/app.ts, block/src/index.ts, test/src/wf.test.ts) updated accordingly.
  • Block facade overhaul: Old hand-written CJS block/index.js + block/index.d.ts are removed; the new block/src/index.ts (TypeScript ESM) uses import.meta.url to compute a URL-based BlockPointer (type: "from-pack-v2", with packUrl and rootUrl) replacing the old type: "dev-v2" filesystem-path pointer.
  • CI updates: Switched runner to hz-ubuntu-dind, removed legacy milaboratory-repo guards, split build into build:dev-local / build:release scripts, added Turbo S3 cache secrets, and dropped the GitHub Packages registry entry.

Confidence Score: 4/5

The migration is mechanical and consistent — every consumer of the renamed model export was updated to platforma, the new facade correctly derives all contract types from the same source of truth, and the URL-based BlockPointer math is sound for both dev and prod entrypoints.

The rename and structurer migration are applied uniformly across all packages. No functional logic was altered. The unquoted S3 URL in prepublishOnly is the only actionable finding.

block/package.json — the prepublishOnly script has an unquoted URL with ? that should be single-quoted.

Important Files Changed

Filename Overview
model/src/index.ts Renames model export to platforma and updates the BlockOutputs type alias accordingly; no logic changes.
block/src/index.ts New auto-generated facade entry: computes from-pack-v2 BlockPointer from import.meta.url, re-exports platforma, and exposes BlockContract, BlockOutputs, BlockData, and block-named aliases.
block/package.json Shifts workspace packages from runtime dependencies to devDependencies (facade is bundled); adds TypeScript ESM exports and ts-builder build target; prepublishOnly URL is unquoted.
.github/workflows/build.yaml Migrates runner to hz-ubuntu-dind, removes legacy repo-guard if: conditions, splits build into dev-local/release scripts, adds Turbo/cache HZ secrets, drops GitHub Packages registry.
test/src/wf.test.ts Updated to use TiteseqAnalysisBlockPointer (from-pack-v2) from this-block and platforma type from the model; comprehensive end-to-end tests with bin-mode and sort-fraction fixtures.
block/src/AGENTS.ts New auto-generated MCP/AI surface file that re-exports block contract types and agents-extra; managed by block-tools structure.
package.json Replaces single build/build:dev scripts with a set of channel-aware scripts; upgrade-sdk now calls block-tools structure refresh; removes bare build entry.
model/package.json Marked private: true; adds dist/index.cjs CJS entry alongside ESM dist/index.js; switches tsconfig to structurer-managed preset.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph model["model package (private)"]
        M[model/src/index.ts\nexport const platforma]
    end
    subgraph block["block package (published)"]
        BI[block/src/index.ts]
        BP["BlockPointer\n{type: from-pack-v2}"]
        BC["BlockContract\n{outputs, data, href}"]
        BA[AGENTS.ts]
    end
    subgraph consumers
        TW[test/src/wf.test.ts]
        UA[ui/src/app.ts]
    end
    M -->|import platforma| BI
    M -->|import type platforma| TW
    BI --> BP
    BI --> BC
    BI --> BA
    BP -->|TiteseqAnalysisBlockPointer| TW
    BC -->|BlockData, BlockOutputs| TW
    M -->|import platforma| UA
Loading
%%{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 model["model package (private)"]
        M[model/src/index.ts\nexport const platforma]
    end
    subgraph block["block package (published)"]
        BI[block/src/index.ts]
        BP["BlockPointer\n{type: from-pack-v2}"]
        BC["BlockContract\n{outputs, data, href}"]
        BA[AGENTS.ts]
    end
    subgraph consumers
        TW[test/src/wf.test.ts]
        UA[ui/src/app.ts]
    end
    M -->|import platforma| BI
    M -->|import type platforma| TW
    BI --> BP
    BI --> BC
    BI --> BA
    BP -->|TiteseqAnalysisBlockPointer| TW
    BC -->|BlockData, BlockOutputs| TW
    M -->|import platforma| UA
Loading

Fix All in Claude Code

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
block/package.json:21
The S3 URL passed to `block-tools publish` contains an unquoted `?` character. When `pnpm` runs this script through `sh -c "…"`, a bare `?` is treated as a single-character glob wildcard. In the default shell, the glob will not expand (no matching files), but with `nullglob` or `failglob` enabled it can silently drop or error on the query-string parameter, causing the publish to use a malformed registry URL. Quoting the URL avoids this entirely.

```suggestion
    "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",
```

Reviews (1): Last reviewed commit: "Structurer migration" | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the block to the block-tools structure layout, upgrades the SDK dependencies to their latest versions, and standardizes configurations across packages (such as tsconfig, oxlint, and turbo). Additionally, the model's block export is renamed from model to platforma to align with the canonical facade contract, and test imports are updated accordingly. The feedback recommends removing the unused eslint dependency from test/package.json as linting has transitioned to oxlint via ts-builder check.

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.

Comment thread test/package.json
Comment on lines 27 to 29
"@platforma-sdk/test": "catalog:",
"eslint": "catalog:",
"typescript": "catalog:",
"vitest": "catalog:"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The eslint dependency is no longer needed in test/package.json because the ESLint configuration (eslint.config.mjs) and the lint script have been removed in favor of oxlint via ts-builder check.

    "@platforma-sdk/test": "catalog:",
    "vitest": "catalog:"

Comment thread block/package.json
},
"scripts": {
"build": "ts-builder build --target block-facade && block-tools pack",
"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",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The S3 URL passed to block-tools publish contains an unquoted ? character. When pnpm runs this script through sh -c "…", a bare ? is treated as a single-character glob wildcard. In the default shell, the glob will not expand (no matching files), but with nullglob or failglob enabled it can silently drop or error on the query-string parameter, causing the publish to use a malformed registry URL. Quoting the URL avoids this entirely.

Suggested change
"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",
"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",
Prompt To Fix With AI
This is a comment left during a code review.
Path: block/package.json
Line: 21

Comment:
The S3 URL passed to `block-tools publish` contains an unquoted `?` character. When `pnpm` runs this script through `sh -c "…"`, a bare `?` is treated as a single-character glob wildcard. In the default shell, the glob will not expand (no matching files), but with `nullglob` or `failglob` enabled it can silently drop or error on the query-string parameter, causing the publish to use a malformed registry URL. Quoting the URL avoids this entirely.

```suggestion
    "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",
```

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code

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.

1 participant