Skip to content

chore(calm-suite): A3 — promote calm-studio + calm-guard to top-level workspaces#2730

Open
gjs-opsflo wants to merge 4 commits into
finos:mainfrom
gjs-opsflo:chore/phase1-a3
Open

chore(calm-suite): A3 — promote calm-studio + calm-guard to top-level workspaces#2730
gjs-opsflo wants to merge 4 commits into
finos:mainfrom
gjs-opsflo:chore/phase1-a3

Conversation

@gjs-opsflo

Copy link
Copy Markdown
Contributor

Description

A3 of the 5-PR Phase 1 sequence under Track A — #2649 (parent epic #2600). Promotes the two calm-suite/ sub-projects to top-level workspaces via git mv, then updates every path-bearing config (CI workflows, root manifests, in-app URLs, schema symlinks, etc.) to match the new layout.

A1 (#2661) and A2 (#2664) are merged. After A3 lands, A4 (identity reconcile) and A5 (tooling unify) can follow, and Phase 2 (Studio surface cleanup, gated on A1+A2+A3 per D-04) unblocks.

What this PR does

Moves (501 tracked files):

  • calm-suite/calm-studio/calm-studio/
  • calm-suite/calm-guard/calm-guard/
  • calm-suite/DEPLOYMENT-RECONCILIATION.mdDEPLOYMENT-RECONCILIATION.md
  • rmdir calm-suite/

The first commit is a pure rename (zero content changes) so git log --follow preserves the full history on every moved file.

Path-bearing config edits (26 files in commit 2):

Category Files
CI workflows (9 replacements) build-calm-studio.yml, build-calm-studio-desktop.yml, build-calm-guard.yml, automated-release-calm-studio.yml
Root config package.json workspaces glob, .github/CODEOWNERS (split /calm-suite/ rule into separate /calm-guard/ + /calm-studio/ rules, same owner list), README.md projects-table links
calm-guard/ package.json repository.directory + homepage, src/app/api/github/create-pr/route.ts (3 user-facing PR-body URLs — would 404 on user PRs otherwise), next.config.ts (new outputFileTracingRoot pin — see below), self-references in AGENTS.md/README.md/docs/{README,docs/contributing,docs/getting-started}.md/docs/docusaurus.config.ts
calm-studio/ packages/calm-core/src/schemas/*.json (8 tracked symlinks retargeted from 6-ups to 5-ups), packages/calm-core/tsup.config.ts (CANONICAL_META resolve depth), apps/studio/vite.config.ts (comment reference)

Lockfile regen (commit 3): incremental method per the pre-existing arborist crash workaround; workspace entries rebased to new paths; 9 orphaned calm-suite/* entries dropped. Invariants preserved: minimatch@10.2.5 hoisted to root (so @vscode/vsce CJS require works), @docusaurus/faster@3.10.1 (from #2673), all 19 rollup platform-specific binaries.

One non-obvious change worth flagging

calm-guard/next.config.ts gains outputFileTracingRoot: path.join(__dirname, '..'). Why: the depth-shift from 2-deep (calm-suite/calm-guard/) to 1-deep (calm-guard/) breaks Next.js's auto-detection of the workspace root. Symptom: Module not found: Can't resolve '../../node_modules/next/dist/client/components/builtin/global-not-found.js' — Next computes the wrong number of ../ because it can mis-pick an unrelated lockfile up the directory tree. Pinning outputFileTracingRoot to the monorepo root makes the resolution deterministic.

What's deliberately NOT in this PR

  • A4 territory: identity reconcile (in-app Report an issue link → FINOS, Guard docs deploy URL, VSCode web fallback) + DEPLOYMENT-RECONCILIATION.md deletion.
  • A5 territory: root tooling unify (vitest base config, eslint flat config, husky/lint-staged/commitlint).
  • Plan-silent items that are documentary only:
    • Root AGENTS.md — describes calm-suite/ as nested sub-monorepos. Prose; needs a follow-up rewrite but not blocking.
    • commitlint.config.jscalm-suite still in scope-enum; A5 already plans to swap for calm-studio + calm-guard. Current calm-suite scope on this PR is still valid.
    • cli/CHANGELOG.md — historical commit messages reference calm-suite/. Left intact for accuracy.
  • A2's deferred items (Phase 10 + Phase 13) stay deferred — production code still imports them: 3 demos in calm-studio/apps/studio/static/demos/ (Toolbar.svelte imports), calm-guard/examples/ (DEMO_ARCHITECTURES imports), calm-studio/docs/{AIGF,REQ,SCHEMA,images} (calm-core/src/aigf/*.ts source comments cite).

Local verification (CI dep order)

  • npm ci exits 0 ✓
  • Each workspace builds clean in the order CI runs them (@finos/calm-models, @calmstudio/{calm-core, extensions, mcp, diagram, studio, github-action}, calmstudio, calmguard, calmguard-docs) ✓
  • npm test exits 0 — 3859+ tests across 15 workspaces ✓
  • cd calm-studio && npx multi-semantic-release --dry-run exits 0 ✓ (A1's deferred calmstudio-workspace manifest still discovers the 8 @calmstudio/* packages via the moved calm-studio/package.json)
  • npm run package --workspace calm-plugins/vscode packages an 8.5 MB .vsix
  • Maven ./mvnw verify deferred to CI (local has Java 11; calm-hub needs 17+)

Type of Change

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

Affected Components

  • CALM Hub UI (calm-hub-ui/) — none directly, but package-lock.json changes touch all workspaces' resolutions
  • Documentation (docs/) — none in core docs, but calm-guard/docs/ self-refs updated
  • Dependencies (lockfile)
  • CI/CD (4 workflows)
  • CALM Guard (calm-guard/) — moved + path-bearing edits
  • CALM Studio (calm-studio/) — moved + symlink + tsup-depth edits

Commit Message Format ✅

Three commits, all DCO-signed (no Co-Authored-By):

  • chore(calm-suite): A3 — git mv calm-suite/* to repo root
  • chore(calm-suite): A3 — update path-bearing config after calm-suite/* move
  • chore(deps): regenerate lockfile after A3 calm-suite/* → root move

Testing

  • I have tested my changes locally (CI dep order — npm ci, all workspace builds, npm test, multi-semantic-release --dry-run, vsce package)
  • All existing tests pass
  • No new tests needed (no behaviour change — A3 is pure structural)

Checklist

  • My commits follow the conventional commit format
  • I have updated documentation if necessary (calm-guard/ self-references; root AGENTS.md prose left for a follow-up)
  • My changes follow the project's coding standards

Refs #2649 (Track A), #2600 (parent epic). Unblocks A4 (#2651 territory), A5 (tooling unify), and Phase 2 (Studio surface cleanup) per D-04 sequencing.

@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.

Clean structural-only A3 move — calm-suite/ fully removed; workspace globs, CODEOWNERS, CI path-filters, the 8 calm-core schema symlinks (now 5-ups), and the tsup CANONICAL_META depth are all correctly retargeted, and the dedicated Build CALM Guard + Build CALM Studio pipelines ran green on this commit (so the next.config.ts outputFileTracingRoot fix is CI-verified). One depth miss inline, plus a doc miss below.

AGENTS.md (root) wasn't updated for the move it makes. The package-guide links […](calm-suite/calm-studio/AGENTS.md) and […](calm-suite/calm-guard/AGENTS.md) (~lines 142–143) now 404, and the workspace-glob description calm-suite/calm-studio/packages/* / …/apps/* (~line 56) contradicts this PR's own package.json. The broader prose rewrite is fine to defer to the follow-up; the dead links and wrong globs are concrete and worth fixing here.

Comment thread calm-studio/apps/studio/vite.config.ts Outdated
@@ -12,7 +12,7 @@ export default defineConfig({
server: {
fs: {
// npm-workspaces installs some deps (e.g. @sveltejs/kit) into
// calm-suite/calm-studio/node_modules, outside Vite's default
// calm-studio/node_modules, outside Vite's default
// allow root at apps/studio. Allow up to the repo root.
allow: [path.resolve('../../../..')],

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.

fs.allow depth wasn't reduced for the move. cwd here is calm-studio/apps/studio, so the repo root is 3 levels up (../../..) — the unchanged ../../../.. now resolves to the repo root's parent (verified: path.resolve('../../../..') → the dir above the repo, ../../.. → the repo root). That widens the dev server's filesystem access beyond the repo and makes the adjacent "Allow up to the repo root" comment inaccurate — a small behaviour change in an otherwise behaviour-neutral PR.

Suggested change
allow: [path.resolve('../../../..')],
allow: [path.resolve('../../..')],

Promotes the two calm-suite sub-projects to top-level workspaces:
- calm-suite/calm-studio/ → calm-studio/
- calm-suite/calm-guard/  → calm-guard/
- calm-suite/DEPLOYMENT-RECONCILIATION.md → DEPLOYMENT-RECONCILIATION.md

Removes the now-empty calm-suite/ directory.

This is a PURE-RENAME commit — zero file content changes — so git's
rename detection preserves the full `git log --follow` chain on every
moved file. CI workflow paths, root workspaces glob, CODEOWNERS,
README, lockfile, and other path-bearing config land in the next
commit.

Refs finos#2649 (Track A), finos#2600 (parent epic). PR finos#3 of the 5-PR Phase 1
sequence; A1 (finos#2661) + A2 (finos#2664) merged.

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

Companion to the previous pure-rename commit. Updates every config that
hard-codes the old `calm-suite/calm-{studio,guard}/` prefix:

CI workflows (9 path replacements):
- .github/workflows/build-calm-studio.yml (paths trigger)
- .github/workflows/build-calm-studio-desktop.yml (working-dir + artifact paths + projectPath + Rust cache workspace)
- .github/workflows/build-calm-guard.yml (paths trigger)
- .github/workflows/automated-release-calm-studio.yml (paths trigger + working-directory)

Root config:
- package.json — workspaces glob: drop `calm-suite/` prefix from 4 entries
- .github/CODEOWNERS — replace `/calm-suite/` with separate `/calm-guard/` + `/calm-studio/` rules (same owner list)
- README.md — projects table links: `./calm-suite/calm-{guard,studio}` → `./calm-{guard,studio}`

calm-guard sub-project:
- calm-guard/package.json — `repository.directory` + `homepage` paths
- calm-guard/src/app/api/github/create-pr/route.ts — 3 user-facing PR-body URLs (would 404 on user PRs without this)
- calm-guard/next.config.ts — add `outputFileTracingRoot` pin to monorepo root. After the depth-shift (2-deep → 1-deep), Next's auto-detection picks the wrong workspace root and emits `../../node_modules/...` instead of `../node_modules/...` for resolved modules. Pinning the root makes the path deterministic.
- calm-guard/AGENTS.md, README.md, docs/README.md, docs/docs/{contributing,getting-started}.md, docs/docusaurus.config.ts — self-references to old `calm-suite/calm-guard/` path (shell command examples + 2 GitHub URL navbar/footer links)

calm-studio sub-project:
- calm-studio/packages/calm-core/src/schemas/*.json — 8 symlinks to `calm/release/1.2/meta/*.json` retargeted from 6-ups to 5-ups (workspace is one level shallower now)
- calm-studio/packages/calm-core/tsup.config.ts — `CANONICAL_META` resolve path: drop one `../` for the same reason
- calm-studio/apps/studio/vite.config.ts — comment path reference

Verified locally (CI dep order):
- `npm ci` exits 0
- All 10 workspace builds pass in CI order (`@finos/calm-models`, `@calmstudio/{calm-core, extensions, mcp, diagram, studio, github-action}`, `calmstudio`, `calmguard`, `calmguard-docs`)
- `npm test` exits 0 — 3859+ tests pass across 15 workspaces
- `cd calm-studio && npx multi-semantic-release --dry-run` exits 0 (A1's deferred manifest deletion still works via the moved `calm-studio/package.json`)

`calm-studio/package.json` (the inherited `calmstudio-workspace` manifest)
remains intact per A1 review feedback — `automated-release-calm-studio.yml`
still resolves it as `working-directory: calm-studio`.

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

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

Signed-off-by: Gourav Shah <gjs@opsflow.sh>
…S.md path corrections

Two corrections from @rocketstack-matt's review of finos#2730:

1. `calm-studio/apps/studio/vite.config.ts:17` — `fs.allow` depth was
   missed in the original A3 sweep. cwd here is `calm-studio/apps/studio`
   (3-deep), so the repo root is `../../..`; the unchanged `../../../..`
   resolves to the dir ABOVE the repo, widening the dev-server's allowed
   filesystem scope beyond the monorepo. Drop one `../` to restore the
   pre-A3 boundary.

2. `AGENTS.md` (root) — two concrete misses from the original A3 sweep:
   - Line 56: workspace-glob description still listed
     `calm-suite/calm-studio/packages/*` and `…/apps/*`, contradicting
     the updated root `package.json` workspaces array in the same PR.
   - Lines 142-143: package-guide links to
     `calm-suite/calm-studio/AGENTS.md` and `calm-suite/calm-guard/AGENTS.md`
     were dead 404s after the directory move. Drop the `calm-suite/`
     prefix from both link text and href.

The broader `AGENTS.md` prose rewrite (section header
"### `calm-suite/` — nested workspaces", surrounding paragraphs)
remains deferred to a follow-up per the reviewer's guidance.

Signed-off-by: Gourav Shah <gjs@opsflow.sh>
…ebased onto Node 26 main)

Rebased onto current origin/main which carried the Node 26 canonical
bump (engines.node >=26.0.0, @types/node ^26, .nvmrc=26.3.1, plus
multiple lockfile regens). Lockfile fully re-regenerated on Node 26
via the incremental method:

  git checkout origin/main -- package-lock.json
  rm -rf node_modules
  npm install --package-lock-only

Workspace entries now resolve to the new top-level paths
(`calm-studio/...`, `calm-guard/...`); no orphaned `calm-suite/*`
entries remain.

Invariants preserved (matches origin/main shape):
- minimatch@10.2.5 hoisted to root (vsce CJS require works)
- @docusaurus/faster@3.10.1 present (from finos#2673)
- All 19 rollup platform-specific optional dependency variants
- @codemirror/autocomplete@6.20.3 (svelte-codemirror-editor peer)

Verified on Node 26.3.1:
- `npm ci` exits 0; 6 @calmstudio/* workspace symlinks resolve
- All 10 workspaces build clean in CI dep order
- `npm test` exits 0 — all tests pass
- `cd calm-studio && npx multi-semantic-release --dry-run` exits 0
- `npm run package --workspace calm-plugins/vscode` packages 8.48 MB .vsix

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

Copy link
Copy Markdown
Contributor Author

@rocketstack-matt addressed both:

1. calm-studio/apps/studio/vite.config.ts:17 — fixed in 747c2048. path.resolve('../../../..')path.resolve('../../..'). Confirmed path.resolve('../../..') from cwd calm-studio/apps/studio → repo root; ../../../.. resolves to the dir above. The fs.allow line wasn't in the path-token sed sweep I ran, hence the miss.

2. Root AGENTS.md — fixed in same commit. L56 workspace globs dropped the calm-suite/ prefix to match the updated package.json workspaces. L142-143 link text and href dropped the prefix so the package-guide links resolve. The section header ### \calm-suite/` — nested workspaces` and the surrounding prose remain — deferred to a follow-up per your guidance.

3. Rebased onto current origin/main (16e27f27). Picked up the Node 26 canonical bump; lockfile fully re-regenerated on Node 26 via the incremental method, no orphaned calm-suite/* entries left. Also resolved the file-location conflict from #2740 (calm-guard/vitest.setup.ts was added on main inside the old path — git auto-translated it to the new location during rebase).

Re-verified on Node 26.3.1:

  • npm ci exits 0
  • All 10 workspaces build clean in CI dep order
  • npm test exits 0
  • cd calm-studio && npx multi-semantic-release --dry-run exits 0
  • npm run package --workspace calm-plugins/vscode packages 8.48 MB .vsix

CI re-running on the force-pushed branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants