Skip to content

Feat/vscode hub integration - #3094

Open
byrash wants to merge 25 commits into
finos:mainfrom
fidelity-contributions:feat/vscode-hub-integration
Open

byrash wants to merge 25 commits into
finos:mainfrom
fidelity-contributions:feat/vscode-hub-integration

Conversation

@byrash

@byrash byrash commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Description

Add CalmHub connectivity to the VSCode extension with OIDC authentication, CURIE resolution chain for Hub-optional validation, and canvas editor controls overlay.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🎨 Code style/formatting changes
  • ♻️ Refactoring (no functional changes)
  • ⚡ Performance improvements
  • ✅ Test additions or updates
  • 🔧 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

Commit Message Format ✅

Testing

  • I have tested my changes locally
  • I have added/updated unit tests
  • All existing tests pass

Checklist

  • My commits follow the conventional commit format
  • I have updated documentation if necessary
  • I have added tests for my changes (if applicable)
  • My changes follow the project's coding standards

@markscott-ms

Copy link
Copy Markdown
Contributor

Marking this PR as "Draft" until a PR description is provided to clarify what it is

@markscott-ms
markscott-ms marked this pull request as draft September 15, 2026 15:13
@byrash

byrash commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Addresses #3047

@byrash

byrash commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Reviewed proposal in #3052

Hub controls browse via domain-scoped API with lazy per-domain loading.
Controls attach as slim references (just requirement-url) — description
and property metadata resolved at load time via enrichment, matching the
building-block drop flow.

Local controls under domain subdirectories (controls/{domain}/{name}.json)
produce CURIEs. Resolver waterfall: cache → Hub → local fallback by slug.
Unversioned CURIEs auto-resolve to latest Hub version.

Remove button visible on all controls regardless of valueOnly mode.
…esolve

Export as Pattern converts the current canvas into a .pattern.json schema
preserving all node properties including colors, controls, and metadata.
Saved to patterns/ and immediately available in Apply Pattern picker.

Fix control resolve: skip SHA cache for unversioned CURIEs, auto-resolve
to latest Hub version, surface actual Hub errors, and accept fallback
identity when Hub schemas lack const identity fields.

Slim control entries: no config or description persisted — resolved from
CURIE at load time. Remove button always visible on controls.
Move NodeResizer inside each node's content div so resize handles
position relative to the visual node boundary. Add box-sizing:
border-box to rectangular nodes to prevent content overflow. Add
Cmd/Ctrl+C/V to duplicate selected nodes with a new ID.
@markscott-ms
markscott-ms marked this pull request as ready for review September 17, 2026 15:08
Hub controls failed to resolve because the plugin passed control names
where the API expects numeric IDs. The resolve flow now looks up the
numeric ID via getControlsForDomain, falls back across all domains when
the CURIE domain doesn't match a Hub domain (namespace/domain mismatch),
and routes numeric-ID calls to /api/calm/domains/ (ControlResource)
instead of /calm/domains/ (MappingControllerResource).

Additional improvements:
- Controls use human-friendly titles as map keys instead of CURIE slugs
- Create Control generates Hub-compatible format with CURIE $id and saves
  into domain subdirectories (controls/{domain}/{slug}.requirement.json)
- Hub-format schemas (no identity constants) are accepted by the scanner
  and resolve paths via fallbackIdentity
- Enrichment triggers immediately after attaching a control
- CURIE links open the Hub UI in the browser
- Remove valueOnly prop — all nodes get full control editing
- Duplicate detection matches by slug and title across domains
Standards and guidelines scanning, fetching, rendering, and associated
tests are no longer needed in the plugin. Removes ~817 lines of dead
code across 13 files including StandardsPanel, scanStandards,
resolveStandardProse, Hub standards fetch, and palette sections.
Fixes raised by rocketstack-matt and markscott-ms:

- Bound inflateRaw output to 20MB to prevent zip-bomb OOM
- Reorder label keyword patterns so specific categories (database,
  network) match before broad actor pattern
- Detect generic-SVG containers by child references, not just style props
- Return nearest text label, not first within radius
- Tighten drawio format detection to require proper XML tag or encoding
- Fall back to generic parser when drawio parse yields zero nodes
- Anchor content= regex to root <svg> tag
- Lenient percent-decode fallback for malformed escapes
- Tag import updates with source: 'import' to bypass echo-suppression
- Compose scale() and matrix() transforms in generic SVG parser
Fixes raised by rocketstack-matt and markscott-ms:

- Bound inflateRaw output to 20MB to prevent zip-bomb OOM
- Reorder label keyword patterns so specific categories (database,
  network) match before broad actor pattern
- Detect generic-SVG containers by child references, not just style props
- Return nearest text label, not first within radius
- Tighten drawio format detection to require proper XML tag or encoding
- Fall back to generic parser when drawio parse yields zero nodes
- Anchor content= regex to root <svg> tag
- Lenient percent-decode fallback for malformed escapes
- Tag import updates with source: 'import' to bypass echo-suppression
- Compose scale() and matrix() transforms in generic SVG parser

This branch has not been deployed

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

Labels

cli Affects `cli` code config shared

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants