Skip to content

feat(calm-explorer): add interactive CALM architecture explorer#1766

Closed
pmerrison wants to merge 104 commits intofinos:mainfrom
pmerrison:feat/calm-visualizer
Closed

feat(calm-explorer): add interactive CALM architecture explorer#1766
pmerrison wants to merge 104 commits intofinos:mainfrom
pmerrison:feat/calm-visualizer

Conversation

@pmerrison
Copy link
Contributor

@pmerrison pmerrison commented Oct 29, 2025

Summary

This PR adds a new CALM Explorer project to the architecture-as-code monorepo, providing an interactive web-based tool for visualising and exploring FINOS CALM (Common Architecture Language Model) architecture diagrams. Full disclosure: I made use of Claude Code in the preparation of this code and PR.

Key Features

  • Interactive Graph Visualisation: Auto-layouted architecture diagrams using ReactFlow and Dagre
  • JSON Editor: Built-in Monaco editor with syntax highlighting and validation
  • Risk Visualisation: Colour-coded risk levels, risk/mitigation badges, and governance control annotations
  • Node Details Panel: Detailed view of node properties, interfaces, risks, and mitigations
  • Control Governance: Display of controls and governance annotations on nodes and edges
  • File Import/Export: Upload and download CALM JSON files
  • Responsive Layout: Resizable panels for optimal workspace management

Technology Stack

  • React 18 with TypeScript
  • Vite for build tooling and dev server
  • ReactFlow for graph visualisation
  • Dagre for automatic graph layout
  • Monaco Editor for JSON editing
  • Tailwind CSS and shadcn/ui component library
  • Vitest for testing (50 passing tests)

Project Integration

This PR includes full integration into the monorepo:

Workspace Configuration

  • ✅ Added calm-explorer to npm workspaces in root package.json
  • ✅ Added build, test, and lint scripts: npm run build:calm-explorer, npm run test:calm-explorer, npm run lint:calm-explorer

CI/CD Integration

  • ✅ Created GitHub Actions workflow: .github/workflows/build-calm-explorer.yml
  • ✅ Updated CVE scanning workflow to include calm-explorer
  • ✅ Updated license scanning workflow to include calm-explorer

Documentation

  • ✅ Added project entry to root README.md with build badge
  • ✅ Comprehensive README in calm-explorer directory
  • ✅ Added calm-explorer scope to commitlint configuration

Code Quality

  • ✅ ESLint configured with TypeScript rules
  • ✅ 50 unit tests with Vitest (100% passing)
  • ✅ All builds and tests verified locally

Testing

All workspace commands have been verified:

npm run build:calm-explorer  # ✅ Build successful
npm run test:calm-explorer   # ✅ 50/50 tests passing
npm run lint:calm-explorer   # ✅ Linting passes (99 warnings, 0 errors)

License Compliance

All direct dependencies use Apache-2.0, MIT, ISC, or BSD licenses. Some transitive dependencies have permissive open-source licenses (BlueOak-1.0.0, MIT-0, 0BSD, CC0-1.0) which are standard in the Node.js ecosystem.

Screenshots

The explorer provides:

  • Left panel: Monaco JSON editor with CALM schema validation
  • Centre panel: Interactive ReactFlow graph with automatic Dagre layout
  • Right panel: Node details showing properties, interfaces, risks, and mitigations
  • Colour-coded risk levels for control visualisation

Maintainer

@pmerrison

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 29, 2025

CLA Missing ID CLA Not Signed

One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via:

Co-authored-by: name <email>

Supported Co-authored-by: formats include:

  1. Anything <id+login@users.noreply.github.com> - it will locate your GitHub user by id part.
  2. Anything <login@users.noreply.github.com> - it will locate your GitHub user by login part.
  3. Anything <public-email> - it will locate your GitHub user by public-email part. Note that this email must be made public on Github.
  4. Anything <other-email> - it will locate your GitHub user by other-email part but only if that email was used before for any other CLA as a main commit author.
  5. login <any-valid-email> - it will locate your GitHub user by login part, note that login part must be at least 3 characters long.

Please update your commit message(s) by doing git commit --amend and then git push [--force] and then request re-running CLA check via commenting on this pull request:

/easycla

Add a new CALM Visualizer project as a workspace module, providing an
interactive web-based tool for visualizing and exploring FINOS CALM
(Common Architecture Language Model) architecture diagrams.

Key features:
- Interactive graph visualization using ReactFlow and Dagre layout
- Integrated Monaco JSON editor with syntax highlighting and validation
- AIGF (AI Governance Framework) risk visualization with color-coded risk levels
- Node details panel showing properties, interfaces, risks, and mitigations
- Control and governance annotations on nodes and edges
- File import/export functionality for CALM JSON files
- Comprehensive test coverage with Vitest (50 passing tests)
- Responsive resizable panel layout

Project integration:
- Add calm-visualizer to npm workspaces
- Create GitHub Actions workflow for build, test, and lint
- Update CVE and license scanning workflows to include calm-visualizer
- Add project to root README with build badge
- Add calm-visualizer scope to commitlint configuration
- Configure eslint with TypeScript rules (warnings for any types)

Technology stack:
- React 18 with TypeScript
- Vite for build tooling
- ReactFlow for graph visualization
- Monaco Editor for JSON editing
- Tailwind CSS and shadcn/ui components
- Vitest for testing with jsdom environment

Maintainer: @pmerrison
@pmerrison pmerrison force-pushed the feat/calm-visualizer branch from f64efae to ba826cb Compare October 29, 2025 10:44
@markscott-ms markscott-ms mentioned this pull request Oct 29, 2025
2 tasks
Fix multiple runtime errors preventing the visualizer from rendering:
- Add Vite resolve aliases to force single React instance across all dependencies
- Add dedupe configuration for React and d3 packages to prevent version conflicts
- Fix controlResolver to handle missing control requirement properties
- Remove invalid defaultSize prop from graph visualization panel
- Install d3-selection, d3-drag, and d3-zoom as direct dependencies

This resolves "Invalid hook call" and "selection5.interrupt is not a function" errors.
@rocketstack-matt rocketstack-matt mentioned this pull request Oct 30, 2025
1 task
@pmerrison
Copy link
Contributor Author

pmerrison commented Nov 3, 2025

Notes:

  • Matt will send me a link to the CCC JSON that isn't rendering properly.
  • Look at test coverage - I need to measure the current coverage and work out where the gaps are
  • Remove the schema folder if it doesn't need to be there (or link to it elsewhere in the repo)
  • Add the experimental banner from the VSCode Extension. (> [!NOTE])
  • Rename folder calm-explorer, and name the project that too
  • Create an experimental folder, put this one in there

@pmerrison
Copy link
Contributor Author

Current test coverage:
Statements: 8.2%
Branch: 70.3%
Funcs: 26.7%

As a follow on item, it would be helpful if I could get some guidance on how to effectively unit test React elements or pointers to where else we've done that in this repo

- Add branch input field to GitHubConnectDialog
- Update GitHubService.getRepoTree to accept optional branch parameter
- When branch specified, use it directly; otherwise fetch default branch
- Add logging for branch being fetched and file count
- Add truncation warning for large repos
- Update tests to reflect new branch parameter behavior

Fixes issue where JSON files on non-default branches (like 'calm' branch)
could not be accessed. Users can now specify any branch to browse files from.
* fix(deps): update minor updates

* chore(deps): update JaCoCo version and enhance dependency grouping in Renovate config

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Matthew Bain <66839492+rocketstack-matt@users.noreply.github.com>
Co-authored-by: rocketstack-matt <matt@rocketstack.co>
Add package-lock.json files to .gitignore to prevent merge conflicts.
The project uses Yarn for package management.
Resolved package-lock.json conflict by removing the file as project uses Yarn.
@pmerrison pmerrison force-pushed the feat/calm-visualizer branch from 5c99983 to 35cf374 Compare November 20, 2025 15:54
@markscott-ms
Copy link
Contributor

#1798 - @pmerrison to fix the build failures relating to package-lock.json missing

Update .gitignore to allow package-lock.json files as they are required
for GitHub Actions CI to pass properly.
Regenerate package-lock.json to ensure all workspace packages are
properly included and synchronized with their package.json files.
Change package name from calm-explorer-vscode to @finos/calm-explorer
to match FINOS naming convention and fix npm ci sync errors in CI.
Regenerate package-lock.json with --include=optional to ensure
platform-specific optional dependencies like @rollup/rollup-linux-x64-gnu
are properly included for CI builds.
Remove the extension build step from the build script as the VS Code
extension functionality is not part of this PR. Only build the webview.
Remove lovable-tagger plugin from vite config as it's an ESM-only
package that causes build failures. This is a development-only tool
that's not needed for CI builds.
Remove vite-plugin-monaco-editor as it's causing module resolution
failures during CI builds. Monaco editor functionality can be added
back later with proper configuration.
Remove extra closing parenthesis that was causing parsing errors.
Copy link
Member

@rocketstack-matt rocketstack-matt left a comment

Choose a reason for hiding this comment

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

Approving into experimental now all builds are passing

@pmerrison pmerrison force-pushed the feat/calm-visualizer branch from 3db1df7 to 594609b Compare November 20, 2025 16:46
@pmerrison
Copy link
Contributor Author

Closing this PR and opening a new one, as it's easier to sort out the merge conflict that way

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.

7 participants