{
    "$schema": "https://calm.finos.org/release/1.2/meta/calm.json",
    "unique-id": "finos-calm-monorepo",
    "name": "FINOS Architecture as Code (CALM) Monorepo",
    "description": "Architecture of the FINOS CALM (Common Architecture Language Model) open-source monorepo, including the CALM Hub backend, UI, CLI tooling, validation server, DevSecOps compliance platform, and desktop studio.",
    "nodes": [
        {
            "unique-id": "architect",
            "node-type": "actor",
            "name": "Architect / Developer",
            "description": "Software architect or developer who uses CALM tooling to model, validate, and manage architectural artifacts."
        },
        {
            "unique-id": "calm-hub",
            "node-type": "service",
            "name": "CALM Hub",
            "description": "Quarkus/Java REST API backend for storing, retrieving, and serving CALM namespaces, architectures, patterns, flows, standards, and controls; also exposes an embedded MCP endpoint at /mcp.",
            "interfaces": [
                {
                    "unique-id": "calm-hub-rest-api",
                    "port": 8080,
                    "path": "/calm"
                },
                {
                    "unique-id": "calm-hub-mcp-endpoint",
                    "port": 8080,
                    "path": "/mcp"
                }
            ]
        },
        {
            "unique-id": "calm-hub-ui",
            "node-type": "webclient",
            "name": "CALM Hub UI",
            "description": "React single-page application for browsing, visualizing, and managing CALM architectures; built and served as static resources embedded inside CALM Hub."
        },
        {
            "unique-id": "calm-server",
            "node-type": "service",
            "name": "CALM Server",
            "description": "Express/Node.js REST API exposing CALM document validation (POST /calm/validate) and a health check (GET /health) as a standalone service.",
            "interfaces": [
                {
                    "unique-id": "calm-server-validate-api",
                    "port": 3000,
                    "path": "/calm/validate",
                    "method": "POST"
                },
                {
                    "unique-id": "calm-server-health-api",
                    "port": 3000,
                    "path": "/health",
                    "method": "GET"
                }
            ]
        },
        {
            "unique-id": "calm-cli",
            "node-type": "service",
            "name": "CALM CLI",
            "description": "Node.js command-line tool providing generate, validate, template, docify, and init-ai commands for working with CALM architecture files."
        },
        {
            "unique-id": "mongodb",
            "node-type": "database",
            "name": "MongoDB",
            "description": "Document database storing CALM namespaces, architectures, patterns, standards, flows, controls, decorators, and user-access records.",
            "interfaces": [
                {
                    "unique-id": "mongodb-connection",
                    "port": 27017
                }
            ]
        },
        {
            "unique-id": "keycloak",
            "node-type": "ecosystem",
            "name": "Keycloak",
            "description": "Keycloak OIDC/OAuth2 identity provider that issues and signs JWT tokens for authenticating users of CALM Hub.",
            "interfaces": [
                {
                    "unique-id": "keycloak-oidc-endpoint",
                    "port": 9443,
                    "path": "/realms/calm-hub-realm"
                }
            ]
        },
        {
            "unique-id": "calm-guard",
            "node-type": "service",
            "name": "CALM Guard",
            "description": "Next.js DevSecOps compliance web application that fetches CALM architectures from GitHub, validates them via calm-cli, and runs parallel AI analysis agents for compliance mapping, pipeline generation, and risk scoring."
        },
        {
            "unique-id": "calm-studio",
            "node-type": "service",
            "name": "CALM Studio",
            "description": "Tauri-based cross-platform desktop application for authoring and visualizing CALM architecture models with a graphical editor."
        },
        {
            "unique-id": "calm-studio-mcp-server",
            "node-type": "service",
            "name": "CALM Studio MCP Server",
            "description": "Standalone Model Context Protocol (MCP) server exposing CALM node, relationship, and architecture tools to AI agent clients via stdio or HTTP.",
            "interfaces": [
                {
                    "unique-id": "mcp-server-http",
                    "port": 3100,
                    "path": "/mcp"
                }
            ]
        },
        {
            "unique-id": "vscode-extension",
            "node-type": "service",
            "name": "CALM VS Code Extension",
            "description": "VS Code extension providing CALM architecture authoring, live validation, diagnostics, and graph visualization within the editor."
        },
        {
            "unique-id": "github-api",
            "node-type": "ecosystem",
            "name": "GitHub API",
            "description": "External GitHub REST API used by CALM Guard to fetch CALM architecture JSON files from repositories and create pull requests with remediation changes.",
            "interfaces": [
                {
                    "unique-id": "github-rest-api",
                    "url": "https://api.github.com"
                }
            ]
        },
        {
            "unique-id": "anthropic-claude",
            "node-type": "ecosystem",
            "name": "Anthropic Claude",
            "description": "External Anthropic AI API providing the Claude Sonnet language model for AI-powered CALM architecture analysis in CALM Guard.",
            "interfaces": [
                {
                    "unique-id": "anthropic-api-endpoint",
                    "url": "https://api.anthropic.com"
                }
            ]
        },
        {
            "unique-id": "openai-gpt",
            "node-type": "ecosystem",
            "name": "OpenAI GPT",
            "description": "External OpenAI API providing GPT-4o as an alternative AI provider for CALM architecture analysis in CALM Guard.",
            "interfaces": [
                {
                    "unique-id": "openai-api-endpoint",
                    "url": "https://api.openai.com"
                }
            ]
        }
    ],
    "relationships": [
        {
            "unique-id": "architect-to-calm-tooling",
            "description": "Architects and developers interact with CALM tooling to author, validate, visualize, and manage architecture models.",
            "relationship-type": {
                "interacts": {
                    "actor": "architect",
                    "nodes": ["calm-hub-ui", "calm-cli", "vscode-extension", "calm-guard", "calm-studio"]
                }
            }
        },
        {
            "unique-id": "calm-hub-ui-to-calm-hub",
            "description": "Sends HTTP REST requests to read and write namespaces, patterns, architectures, flows, decorators, and ADRs.",
            "relationship-type": {
                "connects": {
                    "source": {
                        "node": "calm-hub-ui"
                    },
                    "destination": {
                        "node": "calm-hub",
                        "interfaces": ["calm-hub-rest-api"]
                    }
                }
            }
        },
        {
            "unique-id": "calm-hub-ui-to-keycloak",
            "description": "Performs the OIDC authorization code flow to authenticate users when secure mode is enabled.",
            "relationship-type": {
                "connects": {
                    "source": {
                        "node": "calm-hub-ui"
                    },
                    "destination": {
                        "node": "keycloak",
                        "interfaces": ["keycloak-oidc-endpoint"]
                    }
                }
            }
        },
        {
            "unique-id": "calm-hub-to-mongodb",
            "description": "Reads and writes all CALM namespace data, architectures, patterns, standards, flows, controls, and user-access records.",
            "relationship-type": {
                "connects": {
                    "source": {
                        "node": "calm-hub"
                    },
                    "destination": {
                        "node": "mongodb",
                        "interfaces": ["mongodb-connection"]
                    }
                }
            }
        },
        {
            "unique-id": "calm-hub-to-keycloak",
            "description": "Retrieves OIDC public keys (JWKS) to validate JWT bearer tokens on incoming authenticated requests.",
            "relationship-type": {
                "connects": {
                    "source": {
                        "node": "calm-hub"
                    },
                    "destination": {
                        "node": "keycloak",
                        "interfaces": ["keycloak-oidc-endpoint"]
                    }
                }
            }
        },
        {
            "unique-id": "calm-guard-to-github-api",
            "description": "Fetches CALM architecture JSON files from GitHub repositories and creates pull requests with remediation changes.",
            "relationship-type": {
                "connects": {
                    "source": {
                        "node": "calm-guard"
                    },
                    "destination": {
                        "node": "github-api",
                        "interfaces": ["github-rest-api"]
                    }
                }
            }
        },
        {
            "unique-id": "calm-guard-to-anthropic-claude",
            "description": "Submits CALM architecture content to Claude Sonnet for AI-powered compliance mapping, pipeline generation, cloud infrastructure planning, and risk scoring.",
            "relationship-type": {
                "connects": {
                    "source": {
                        "node": "calm-guard"
                    },
                    "destination": {
                        "node": "anthropic-claude",
                        "interfaces": ["anthropic-api-endpoint"]
                    }
                }
            }
        },
        {
            "unique-id": "calm-guard-to-openai-gpt",
            "description": "Submits CALM architecture content to GPT-4o as an alternative AI provider when Anthropic is not configured.",
            "relationship-type": {
                "connects": {
                    "source": {
                        "node": "calm-guard"
                    },
                    "destination": {
                        "node": "openai-gpt",
                        "interfaces": ["openai-api-endpoint"]
                    }
                }
            }
        },
        {
            "unique-id": "calm-guard-to-calm-cli",
            "description": "Invokes calm-cli as a child process to validate CALM JSON documents server-side.",
            "relationship-type": {
                "connects": {
                    "source": {
                        "node": "calm-guard"
                    },
                    "destination": {
                        "node": "calm-cli"
                    }
                }
            }
        },
        {
            "unique-id": "calm-cli-to-calm-hub",
            "description": "Fetches remote CALM patterns and schemas from CALM Hub when a --calm-hub-url is supplied.",
            "relationship-type": {
                "connects": {
                    "source": {
                        "node": "calm-cli"
                    },
                    "destination": {
                        "node": "calm-hub",
                        "interfaces": ["calm-hub-rest-api"]
                    }
                }
            }
        },
        {
            "unique-id": "calm-server-to-calm-hub",
            "description": "Optionally loads remote CALM schemas from CALM Hub for document validation when --calm-hub-url is configured.",
            "relationship-type": {
                "connects": {
                    "source": {
                        "node": "calm-server"
                    },
                    "destination": {
                        "node": "calm-hub",
                        "interfaces": ["calm-hub-rest-api"]
                    }
                }
            }
        }
    ]
}
