Skip to content

fix(block-tools): keep the mark-stable script on the block facade - #1790

Merged
AStaroverov merged 1 commit into
mainfrom
chore/keep-mark-stable-script-on-facade
Aug 19, 2026
Merged

fix(block-tools): keep the mark-stable script on the block facade#1790
AStaroverov merged 1 commit into
mainfrom
chore/keep-mark-stable-script-on-facade

Conversation

@AStaroverov

@AStaroverov AStaroverov commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Problem

Blocks migrated to the new project template fail their Mark Platforma Block as Stable workflow:

ERR_PNPM_NO_SCRIPT  Missing script: mark-stable

Example: clonotype-browser run.

The facade rule carried an unconditional removeScript("mark-stable") (tools/block-tools/src/structure/rules/block-package-json.ts), introduced in 6ff3423b2 with the rationale "Legacy script from the pre-facade boilerplate — gone in the slim facade" (comment later dropped in 9b62f2cab).

It is not boilerplate. The engine itself generates .github/workflows/mark-stable.yaml (rules/root-ci.ts:47) from templates/text/workflows/mark-stable.tpl.yaml, which calls the reusable milaboratory/github-ci/.github/workflows/block-mark-stable.yaml@v4 — and that workflow does cd "${BLOCK_PATH}" (default block) followed by pnpm run mark-stable. So the structurer generates a workflow and then removes the script that workflow needs.

The root "mark-stable": "turbo run mark-stable" is not a substitute: CI never invokes it, and no package implements the turbo task declared in rules/root-turbo-json.ts:49.

The removal also contradicts the spec. A-0013 (facade package.json) defines the canonical scripts as build / check / prepublishOnly / do-pack and states: "Block-specific scripts beyond the canonical four — engine leaves them." mark-stable is not mentioned anywhere in the facade project docs — no atom, no decision, no open question.

Change

  • Drop removeScript("mark-stable") from the facade rule (and the now-unused import).
  • Add a refresh test asserting a pre-existing mark-stable survives structure refresh. Verified it fails on the current code and passes with the fix.

pnpm run check and all 257 structurer tests pass.

Out of scope

  • Restoring the script in the blocks that already lost it. Affected today: clonotype-browser, clonotype-clustering, mixcr-clonotyping, mixcr-scfv-clonotyping, rarefaction, samples-and-data, antibody-tcr-lead-selection. This PR only stops the engine from removing it again; each block needs the line back. First one: chore: restore mark-stable script on the block facade platforma-open/clonotype-browser#45.
  • Whether mark-stable should be engine-ensured on the facade (so refresh repairs those blocks automatically), or whether the whole mark-stable path should be retired now that block-tools publish adds the package to the stable channel unless --unstable is passed. Both are real options and need a decision + an atom; neither belongs in a regression fix.

Greptile Summary

The PR stops structure refresh from deleting a block facade’s pre-existing mark-stable script and adds regression coverage for preservation.

  • Block facade — the slim block/ package representing the publishable block entry point; refresh now leaves its noncanonical author-defined scripts unchanged.
  • mark-stable script — a package script invoked by the generated stable-release workflow; this PR preserves an existing script but deliberately does not create or restore one.
  • Canonical scriptsbuild, check, prepublishOnly, and do-pack, whose commands remain managed by the structurer.
  • Structure refresh — the rule-engine operation that reconciles an existing block repository with the canonical layout; the new test verifies it no longer removes mark-stable.
  • Mark-stable workflow — generated CI that delegates to the reusable GitHub workflow and runs the facade script from block/; its contract is unchanged.

Confidence Score: 5/5

The PR appears safe to merge, with no actionable defects identified in the changed behavior.

The rule now preserves the workflow-required facade script without changing canonical-script enforcement, and the regression test exercises the affected refresh path.

Important Files Changed

Filename Overview
tools/block-tools/src/structure/rules/block-package-json.ts Removes the targeted deletion of mark-stable, allowing noncanonical author scripts to survive package reconciliation.
tools/block-tools/src/structure/tests/facade-end-state.test.ts Adds focused refresh coverage proving that an existing mark-stable command is preserved exactly.
.changeset/keep-mark-stable-script-on-facade.md Accurately documents the workflow failure, preservation fix, and patch-level release impact.

Reviews (1): Last reviewed commit: "fix(block-tools): keep the mark-stable s..." | Re-trigger Greptile

Context used:

The facade rule carried an unconditional `removeScript("mark-stable")`,
classifying the script as a pre-facade boilerplate leftover. It is not:
the engine-generated `.github/workflows/mark-stable.yaml` calls
`milaboratory/github-ci/.github/workflows/block-mark-stable.yaml@v4`,
which does `cd block && pnpm run mark-stable`. Blocks migrated to the new
layout lost the script, so their "Mark Platforma Block as Stable"
workflow fails with `ERR_PNPM_NO_SCRIPT  Missing script: mark-stable`.

Drop the call, restoring what A-0013 specifies: the engine overwrites the
canonical build/check/prepublishOnly/do-pack scripts and leaves
block-specific scripts beyond that set alone. Covered by a refresh test
that asserts a pre-existing `mark-stable` survives.
@changeset-bot

changeset-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 976be34

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@platforma-sdk/block-tools Patch
@milaboratories/pl-middle-layer Patch
@platforma-sdk/pl-cli Patch
@platforma-sdk/test Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.98%. Comparing base (3280c4e) to head (976be34).
⚠️ Report is 6 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1790      +/-   ##
==========================================
- Coverage   52.98%   52.98%   -0.01%     
==========================================
  Files         412      412              
  Lines       21322    21321       -1     
  Branches     4761     4761              
==========================================
- Hits        11298    11296       -2     
+ Misses       8663     8661       -2     
- Partials     1361     1364       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AStaroverov
AStaroverov enabled auto-merge August 19, 2026 15:25
@AStaroverov
AStaroverov added this pull request to the merge queue Aug 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 19, 2026
@AStaroverov
AStaroverov added this pull request to the merge queue Aug 19, 2026
Merged via the queue into main with commit ca5016a Aug 19, 2026
27 of 30 checks passed
@AStaroverov
AStaroverov deleted the chore/keep-mark-stable-script-on-facade branch August 19, 2026 17:03
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