Skip to content

chore(calm-suite): A1 — remove vestigial config and rewrite file: deps to bare workspace#2661

Open
gjs-opsflo wants to merge 2 commits into
finos:mainfrom
gjs-opsflo:chore/phase1-a1
Open

chore(calm-suite): A1 — remove vestigial config and rewrite file: deps to bare workspace#2661
gjs-opsflo wants to merge 2 commits into
finos:mainfrom
gjs-opsflo:chore/phase1-a1

Conversation

@gjs-opsflo

@gjs-opsflo gjs-opsflo commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Description

A1 of the 5-PR Phase 1 sequence under Track A — #2649 (parent epic #2600). Removes vestigial config from calm-suite/calm-studio/ and rewrites every deep file: workspace dep to bare semver "*", then regenerates the root lockfile. No behaviour change.

The purpose of A1 is to shrink the surface area before A3's large git mv: npm 11 auto-symlinks "*" workspace deps regardless of path depth, so once these refs become path-agnostic, A3 can move calm-suite/calm-studio/ → root without touching dependency declarations.

What this PR does

Deletions (8 paths)

  • calm-suite/calm-studio/vercel.json — no Vercel deploy target for this workspace.
  • calm-suite/calm-studio/package.json — the calmstudio-workspace root manifest was a nested-workspace artifact; the repo-root package.json already declares calm-suite/calm-studio/packages/* and calm-suite/calm-studio/apps/* as workspaces.
  • calm-suite/calm-studio/packages/calmscript/ — DSL stub, not consumed by any other package.
  • calm-suite/calm-studio/apps/studio/.releaserc.json
  • calm-suite/calm-studio/packages/calm-core/.releaserc.json
  • calm-suite/calm-studio/packages/extensions/.releaserc.json
  • calm-suite/calm-studio/packages/mcp-server/.releaserc.json
  • calm-suite/calm-studio/packages/calmscript/.releaserc.json (via dir delete)

Rewrites (11 file: → bare "*" across 6 package.json files)

  • packages/calm-core: @finos/calm-models
  • packages/mcp-server: @calmstudio/calm-core (deps + devDeps), @finos/calm-models
  • packages/github-action: @calmstudio/calm-core, @calmstudio/mcp
  • packages/vscode-extension: @calmstudio/mcp
  • packages/web-component: @calmstudio/calm-core, @calmstudio/extensions
  • apps/studio: @calmstudio/calm-core, @calmstudio/extensions

Lockfile regenerated in a separate atomic commit. All 6 @calmstudio/* workspace symlinks resolve and all 19 rollup platform-specific optional dependency variants are preserved (matches origin/main shape — validate-lockfile CI guard upheld).

Pre-flight: multi-semantic-release dry-run

Before deleting the 5 .releaserc.json files, ran npx multi-semantic-release --dry-run from calm-suite/calm-studio/ after temporarily removing the configs. Result: exit 0, all 8 packages loaded, all plugins resolved. Per-package .releaserc.json files are vestigial — multi-semantic-release discovers config from the root release field or package-level defaults.

Deviations from the documented ritual

  1. Lockfile regeneration. AGENTS.md's rm -rf node_modules package-lock.json && npm install ritual crashes inside arborist.buildIdealTree with TypeError: Cannot read properties of null (reading 'matches') on both npm 11.12.1 (Corepack) and npm 10.9.7. The same crash reproduces on plain origin/main with no rewrites, confirming this is a pre-existing arborist dedupe bug, not a regression from A1. Workaround: incremental npm install --package-lock-only against the existing origin/main lockfile (preserves hoist decisions including minimatch@3.1.5 at root — vsce CJS-requires that shape), then npm ci. Bitwise-equivalent to the documented ritual for the fields validate-lockfile CI checks (19 rollup platform variants). An earlier attempt used npm install --force to bypass the buggy PlaceDep.pruneDedupable path, but --force skips dedupe and left minimatch@9.0.9 nested under calm-plugins/vscode/, breaking @vscode/vsces CJS require("minimatch") in CI — replaced by the incremental method in a629650e.

  2. ./mvnw verify not run locally. Quarkus 3.34 requires Java 17+, only Java 11 (Temurin) available in the local environment. Maven verification deferred to CI on this PR.

  3. calmguard-docs build failure is pre-existing. npm run build fails in calm-suite/calm-guard/docs with Cannot find package '@docusaurus/faster'. Verified by stashing all A1 changes and running npm ci && npm run build --workspace calmguard-docs against unmodified origin/main — same failure. Not in A1 scope.

What was deliberately NOT touched

  • calm-suite/calm-guard/package.json's @finos/calm-cli: "^1.33.0" — real semver-published dep, not a file: workspace ref.
  • calmscript UI residue in apps/studio (Toolbar.svelte, +page.svelte, export.ts, CodePanel.svelte) — Phase 2 (STUDIO-01) owns these.
  • All non-workspace deps (ajv, react, next, etc.).

Type of Change

  • 🔧 Chore (maintenance, dependencies, CI, etc.)

Affected Components

  • CLI (cli/)
  • Schema (calm/)
  • CALM AI (calm-ai/)
  • CALM Hub (calm-hub/)
  • CALM Hub UI (calm-hub-ui/)
  • CALM Server (calm-server/)
  • CALM Widgets (calm-widgets/)
  • Documentation (docs/)
  • Shared (shared/)
  • VS Code Extension (calm-plugins/vscode/)
  • Dependencies
  • CI/CD

Also affects calm-suite/calm-studio/ workspaces (calm-core, mcp-server, github-action, vscode-extension, web-component, apps/studio).

Commit Message Format ✅

Both commits use the calm-suite scope (still valid pre-A3) and are DCO-signed:

  • chore(calm-suite): A1 — remove vestigial config and rewrite file: deps to bare workspace
  • chore(deps): regenerate lockfile after A1 file: → bare-workspace rewrite

Testing

  • I have tested my changes locally
  • I have added/updated unit tests (no behaviour change — no new tests needed)
  • All existing tests pass

Local verification (Mac, Node 22.22.2, npm 11.12.1):

  • npm run build: ✓ green for all workspaces except pre-existing calmguard-docs failure (reproduces on origin/main).
  • npm test: ✓ green — all 3859+ tests pass across 15 workspaces (calm-models 190, calm-widgets 842, shared 842, cli 385, calm-server 11, calm-hub-ui 747, calm-plugins/vscode 433, calm-guard 111, calm-studio packages+apps 690).
  • STRUCT-01 smoke assertions all pass: 6 @calmstudio/* symlinks resolved (≥ relaxed -ge 4 threshold per 01-VALIDATION.md), 8 vestigial paths removed, 0 "file: refs remain in calm-suite/calm-studio/.

Checklist

  • My commits follow the conventional commit format
  • I have updated documentation if necessary (no user-facing doc changes — internal config only)
  • I have added tests for my changes (if applicable)
  • My changes follow the project's coding standards

Refs #2649 (Track A), #2600 (parent epic). A2..A5 will follow.

gjs-opsflo added a commit to gjs-opsflo/architecture-as-code that referenced this pull request Jun 16, 2026
Lockfile reflects bare semver "*" workspace references for the 11
@calmstudio/* and @finos/calm-models entries rewritten in A1. All 6
@calmstudio/* workspace symlinks resolve (calm-core, diagram, extensions,
github-action, mcp, studio) and @finos/calm-models symlink resolves to
the top-level calm-models workspace. All 19 rollup platform-specific
optional dependency variants preserved (matches origin/main shape — npm
validate-lockfile CI workflow guard upheld).

Regen method:
The documented `rm -rf node_modules package-lock.json && npm install`
ritual crashes inside `arborist.buildIdealTree` with
`TypeError: Cannot read properties of null (reading 'matches')` on both
npm 11.12.1 (via Corepack) and npm 10.9.7 — same crash reproduces on
plain `origin/main`, confirming a pre-existing arborist dedupe bug.

Initial attempt used `npm install --force` to bypass the crash, but
`--force` skips PlaceDep dedupe, leaving `minimatch@9.0.9` nested under
`calm-plugins/vscode/node_modules/` instead of allowing `minimatch@3.1.5`
to hoist to the root `node_modules/`. That broke `@vscode/vsce`'s CJS
`require('minimatch')` (it expects the v3 default-export function, not
the v9 named export), surfacing as
`(0, minimatch_1.minimatch) is not a function` in CI on PR finos#2661.

Working method: keep the existing `origin/main` lockfile and run
`rm -rf node_modules && npm install --package-lock-only`. This performs
an incremental package-lock update from the current `package.json`
workspace edits without rebuilding the whole tree, so the hoist
decisions baked into `origin/main`'s lockfile are preserved
(minimatch@3.1.5 stays hoisted to root, vsce works). Then
`npm ci` installs cleanly from the updated lockfile.

Result is bitwise-equivalent to the documented ritual for the fields
`validate-lockfile` CI checks (19 rollup platform variants present)
and additionally preserves the hoist tree (minimatch@3.1.5 at root).

Signed-off-by: Gourav Shah <gjs@opsflow.sh>
@gjs-opsflo

Copy link
Copy Markdown
Contributor Author

CI fix pushed (force-push to chore/phase1-a1). Rev a629650e replaces the original lockfile commit 8428f6e5.

Root cause: The original commit used npm install --force to bypass the pre-existing arborist.buildIdealTree crash described in the PR body. --force skips PlaceDep.pruneDedupable, so minimatch@9.0.9 got nested under calm-plugins/vscode/node_modules/ instead of letting minimatch@3.1.5 hoist to root. @vscode/vsce CJS-requires the v3 default-export function shape and broke with the v9 named-export shape:

Error: (0 , minimatch_1.minimatch) is not a function

Fix: Instead of regenerating the lockfile from scratch, keep the origin/main lockfile and run an incremental update from the new package.json edits:

git checkout origin/main -- package-lock.json
rm -rf node_modules
npm install --package-lock-only   # incremental — keeps origin/main's hoist decisions
npm ci                            # clean install from updated lockfile

Verified locally:

  • node_modules/minimatch = 3.1.5 (hoisted to root, matches origin/main)
  • No calm-plugins/vscode/node_modules/minimatch entry
  • 19 rollup platform-specific binaries preserved (validate-lockfile guard)
  • npm run package --workspace calm-plugins/vscode → exits 0, .vsix packaged
  • All 3859+ vitest tests still pass
  • npm run build still green for everything except the pre-existing calmguard-docs @docusaurus/faster failure (unchanged from origin/main, documented above)

PR body's "Deviations from the documented ritual" section is now accurate as of a629650e.

eddie-knight
eddie-knight previously approved these changes Jun 16, 2026

@rocketstack-matt rocketstack-matt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the quick turnaround on the packaging fix — dropping the @vscode/vsce > minimatch override and regenerating resolves the minimatch is not a function failure I was seeing; I verified locally that npm ci + npm run package:vscode now packages the VSIX cleanly and validate-lockfile-platforms still passes. A1 scope itself looks right: the deletions and the file: → bare-workspace rewrites are clean, and nothing imports the removed @calmstudio/calmscript.

One thing left before this is safe to merge, on the "no behaviour change" criterion — see the inline comment on the deleted calm-suite/calm-studio/package.json. Removing that manifest breaks automated-release-calm-studio.yml. It won't show up as a check here because that workflow only runs on push to main, but the merge of this PR touches calm-suite/calm-studio/**, so it'll fire on main straight after merge and fail.

Given A1 is explicitly the "remove vestigial release config" step, I think the cleanest fix is to also delete automated-release-calm-studio.yml in this PR (the per-package .releaserc.json and the multi-semantic-release tooling it drove are already going). If you'd rather keep that workflow removal with the CI-path changes in A3, that's fine too — but let's make the deferral explicit and tracked so main doesn't sit with a red release job in between.

"@semantic-release/github": "^12.0.6",
"@semantic-release/npm": "^13.1.5",
"husky": "^9.1.7",
"multi-semantic-release": "^3.1.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Deleting this calmstudio-workspace manifest leaves automated-release-calm-studio.yml broken. That workflow does working-directory: calm-suite/calm-studio then npx multi-semantic-release, and multi-semantic-release relies on this file's workspaces array (and the multi-semantic-release devDep declared right here) to discover the @calmstudio/* packages. With no package.json in that directory and no release field at the repo root, the release job fails.

The --dry-run referenced in the PR description was run with this manifest still present (only the .releaserc.json files removed), so it didn't exercise the post-merge state.

Suggest deleting automated-release-calm-studio.yml in this PR alongside the rest of the vestigial release config, or deferring it explicitly to A3 with a tracking note.

gjs-opsflo added a commit to gjs-opsflo/architecture-as-code that referenced this pull request Jun 17, 2026
… body, no diff per D-10/D-10a)

Empty commit anchoring PR finos#2 of the 5-PR Phase 1 sequence (Track A — finos#2649).

Per D-09 (Phase 1 inventory-only — no deletions) AND amended D-10 (manifest publishes inline in PR body; no committed file), the A2 deliverable is the PR body itself.
The PR diff is empty by design. The 23-row manifest is in the PR description.

D-10a corollary: a durable second copy of the manifest lives in this phase's planning archive (`.planning/phases/01-track-a-structural-cleanup/01-CONTEXT.md` — `Deferred Ideas → Phase 1 A2 manifest (durable copy per D-10a)`) which is gitignored from this branch but persists in the contributor's local working copy, so the manifest survives independently of GitHub PR archaeology.

D-04 sequencing: Phase 2 (Studio surface cleanup) unblocks once A1 (PR finos#2661) + A2 both merge.

Refs finos#2649 (Track A), finos#2600 (parent epic).

Signed-off-by: Gourav Shah <gjs@opsflow.sh>
gjs-opsflo added a commit to gjs-opsflo/architecture-as-code that referenced this pull request Jun 17, 2026
…s to bare workspace

Implements STRUCT-01.

Deletions (7 paths — review fix: calmstudio-workspace manifest kept):
- calm-suite/calm-studio/vercel.json (no Vercel deploy target)
- calm-suite/calm-studio/packages/calmscript/ (DSL stub — not consumed)
- calm-suite/calm-studio/apps/studio/.releaserc.json
- calm-suite/calm-studio/packages/calm-core/.releaserc.json
- calm-suite/calm-studio/packages/extensions/.releaserc.json
- calm-suite/calm-studio/packages/mcp-server/.releaserc.json
- calm-suite/calm-studio/packages/calmscript/.releaserc.json (via dir delete)

Rewrites (11 file: -> bare semver "*" across 6 package.json files):
- packages/calm-core: @finos/calm-models
- packages/mcp-server: @calmstudio/calm-core (deps + devDeps), @finos/calm-models
- packages/github-action: @calmstudio/calm-core, @calmstudio/mcp
- packages/vscode-extension: @calmstudio/mcp
- packages/web-component: @calmstudio/calm-core, @calmstudio/extensions
- apps/studio: @calmstudio/calm-core, @calmstudio/extensions

Trim (1 line):
- calm-suite/calm-studio/package.json (calmstudio-workspace manifest):
  remove `packages/calmscript` entry from workspaces[] (now-deleted directory)

Review fix per @rocketstack-matt feedback on finos#2661: the calmstudio-workspace
manifest (`calm-suite/calm-studio/package.json`) is KEPT, not deleted, because
.github/workflows/automated-release-calm-studio.yml runs
`npx multi-semantic-release` from `calm-suite/calm-studio/` and relies on
this manifest's workspaces[] array to discover @calmstudio/* packages.
The eventual removal of this manifest is deferred to A3 (finos#1-03), where it
co-locates with the `git mv calm-suite/* -> root` move and the workflow's
`working-directory: calm-suite/calm-studio` update.

Verified locally:
- `npm ci` exits 0
- `npm run package --workspace calm-plugins/vscode` exits 0 (vsce packages 8.5MB .vsix)
- `cd calm-suite/calm-studio && npx multi-semantic-release --dry-run` exits 0
  (all 8 @calmstudio/* packages discovered via the workspaces[] array)

Lockfile regeneration follows in a separate commit per AGENTS.md ritual.

Signed-off-by: Gourav Shah <gjs@opsflow.sh>
@gjs-opsflo

Copy link
Copy Markdown
Contributor Author

@rocketstack-matt thank you for catching the automated-release-calm-studio.yml break — that workflow runs only on push to main so I'd missed it. Force-pushed 676f665d taking your second suggestion (defer the manifest deletion to A3 where it co-locates with the path move and the workflow's working-directory: update).

What changed in this rev:

  1. Kept calm-suite/calm-studio/package.json (the calmstudio-workspace manifest) — so multi-semantic-release still finds the workspaces array.
  2. Trimmed one line from it: removed packages/calmscript from workspaces[] (that directory is deleted in this PR, so the entry would dangle).
  3. Regenerated the lockfile via the incremental method (origin/main lockfile + npm install --package-lock-only) instead of the earlier --force approach, which preserves origin/main's hoist tree.

Verified locally:

  • npm ci exits 0
  • npm run package --workspace calm-plugins/vscode exits 0 (vsce packages an 8.5 MB .vsix)
  • cd calm-suite/calm-studio && npx multi-semantic-release --dry-run exits 0 (all 8 @calmstudio/* packages discovered via the workspaces array — the exact path the workflow takes)

Defer note (A3 scope): The calmstudio-workspace manifest gets deleted in A3 (the large git mv calm-suite/* → root PR) where the workflow's working-directory: calm-suite/calm-studio line also has to change to working-directory: calm-studio anyway, so it's the natural place to delete the now-unnecessary intermediate manifest.

Re-requesting review.

…s to bare workspace

Implements STRUCT-01.

Deletions (7 paths — review fix: calmstudio-workspace manifest kept):
- calm-suite/calm-studio/vercel.json (no Vercel deploy target)
- calm-suite/calm-studio/packages/calmscript/ (DSL stub — not consumed)
- calm-suite/calm-studio/apps/studio/.releaserc.json
- calm-suite/calm-studio/packages/calm-core/.releaserc.json
- calm-suite/calm-studio/packages/extensions/.releaserc.json
- calm-suite/calm-studio/packages/mcp-server/.releaserc.json
- calm-suite/calm-studio/packages/calmscript/.releaserc.json (via dir delete)

Rewrites (11 file: -> bare semver "*" across 6 package.json files):
- packages/calm-core: @finos/calm-models
- packages/mcp-server: @calmstudio/calm-core (deps + devDeps), @finos/calm-models
- packages/github-action: @calmstudio/calm-core, @calmstudio/mcp
- packages/vscode-extension: @calmstudio/mcp
- packages/web-component: @calmstudio/calm-core, @calmstudio/extensions
- apps/studio: @calmstudio/calm-core, @calmstudio/extensions

Trim (1 line):
- calm-suite/calm-studio/package.json (calmstudio-workspace manifest):
  remove `packages/calmscript` entry from workspaces[] (now-deleted directory)

Review fix per @rocketstack-matt feedback on finos#2661: the calmstudio-workspace
manifest (`calm-suite/calm-studio/package.json`) is KEPT, not deleted, because
.github/workflows/automated-release-calm-studio.yml runs
`npx multi-semantic-release` from `calm-suite/calm-studio/` and relies on
this manifest's workspaces[] array to discover @calmstudio/* packages.
The eventual removal of this manifest is deferred to A3 (finos#1-03), where it
co-locates with the `git mv calm-suite/* -> root` move and the workflow's
`working-directory: calm-suite/calm-studio` update.

Verified locally:
- `npm ci` exits 0
- `npm run package --workspace calm-plugins/vscode` exits 0 (vsce packages 8.5MB .vsix)
- `cd calm-suite/calm-studio && npx multi-semantic-release --dry-run` exits 0
  (all 8 @calmstudio/* packages discovered via the workspaces[] array)

Lockfile regeneration follows in a separate commit per AGENTS.md ritual.

Signed-off-by: Gourav Shah <gjs@opsflow.sh>
Lockfile reflects:
- 11 file: -> bare semver "*" workspace deps (calm-core, mcp-server,
  github-action, vscode-extension, web-component, apps/studio)
- calm-suite/calm-studio/packages/calmscript entry removed (directory
  deleted in A1's first commit)
- @docusaurus/faster@3.10.1 retained (added by finos#2673 on main)
- minimatch@10.2.5 hoisted to root (matches main; vsce CJS require works)
- @codemirror/autocomplete@6.20.3 preserved (svelte-codemirror-editor peer)
- All 19 rollup platform-specific optional dependency variants preserved
  (validate-lockfile guard upheld)

Regen method: incremental `npm install --package-lock-only` against the
current origin/main lockfile, then a one-line jq script to remove the
stale `calm-suite/calm-studio/packages/calmscript` entry. Avoids the
known arborist crash on a clean `rm -rf node_modules package-lock.json
&& npm install` flow.

Verified locally:
- `npm ci` exits 0
- `cd calm-suite/calm-studio && npx multi-semantic-release --dry-run` exits 0
  (8 @calmstudio/* packages discovered)
- `npm run package --workspace calm-plugins/vscode` exits 0 (vsce packages
  8.5 MB .vsix)

Signed-off-by: Gourav Shah <gjs@opsflow.sh>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants