Reference Documentation - Language Specification
Architectural Governance
Defines the CALM-based DSL for formally describing, validating, and governing enterprise architecture within SEA-Forge™. Based on the FINOS CALM standard, this specification enables Architecture-as-Code practices and automated architectural governance.
The Common Architecture Language Model (CALM) provides a machine-readable blueprint for enterprise systems. Within SEA-Forge™’s Architectural Governance pillar, CALM serves as the formal language for defining architectural intent, enforcing constraints, and preventing drift.
FINOS CALM Project: https://github.com/finos/architecture-as-code
Specification: JSON/YAML-based architecture definition language
Architectural definitions are treated as code:
File Format: my-system.arch.json or my-system.arch.yaml
Architects declare the desired state of the architecture (what it should be), not imperative steps (how to build it).
Example:
1
2
3
4
5
nodes:
- id: payment-service
type: service
metadata:
encryption: required
Not:
1
2
3
1. Create payment service
2. Enable encryption
3. Deploy to Kubernetes
The DSL is expressed in JSON (or YAML as a superset), enabling:
The core CALM schema can be extended with custom metadata and controls to meet:
The CALM DSL serves as input for generating:
A CALM document consists of four primary components:
1
2
3
4
5
6
{
"nodes": [...], // Architectural components
"relationships": [...], // Component interactions
"metadata": {...}, // Document-level properties
"controls": [...] // Governance policies
}
Nodes represent the fundamental building blocks of the architecture.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"nodes": [
{
"id": "order-service",
"name": "Order Processing Service",
"type": "service",
"description": "Microservice responsible for handling customer orders.",
"metadata": {
"domain": "Sales",
"team": "Alpha Squad",
"language": "Python",
"deployment": "Kubernetes"
},
"controls": [
{
"id": "data-encryption-at-rest",
"description": "All persistent data must be encrypted at rest.",
"status": "compliant"
}
]
}
]
}
| Attribute | Type | Required | Description |
|---|---|---|---|
id |
string | ✅ | Unique identifier (kebab-case recommended) |
name |
string | ✅ | Human-readable name |
type |
string | ✅ | Node categorization (see below) |
description |
string | ❌ | Detailed explanation of purpose |
metadata |
object | ❌ | Custom key-value attributes |
controls |
array | ❌ | Applicable governance policies |
Standard Types:
service - Microservice, API, backend servicedatabase - Relational DB, NoSQL, graph databasequeue - Message queue, event streamexternal-api - Third-party API, SaaS integrationui-component - Frontend application, web UISEA-Forge™ Extensions:
ai-agent - AI/ML service, LLM agentcognitive-engine - Artifact generation, recommendation serviceknowledge-graph - Oxigraph, semantic data storedsl-runtime - CADSL renderer, SBVR processorDomain Context:
1
2
3
4
5
"metadata": {
"domain": "Sales", // DDD Bounded Context
"boundedContext": "OrderManagement",
"aggregateRoot": "Order"
}
Team Ownership:
1
2
3
4
5
"metadata": {
"team": "Alpha Squad",
"owner": "john.doe@company.com",
"oncall": "alpha-oncall@company.com"
}
Technology Stack:
1
2
3
4
5
6
"metadata": {
"language": "Python",
"framework": "FastAPI",
"database": "PostgreSQL",
"messageQueue": "RabbitMQ"
}
Deployment:
1
2
3
4
5
6
"metadata": {
"deployment": "Kubernetes",
"namespace": "production",
"replicas": 3,
"region": "us-east-1"
}
Data Classification:
1
2
3
4
"metadata": {
"dataClassification": "PII", // Personally Identifiable Information
"complianceScope": ["GDPR", "HIPAA"]
}
Semantic Core Link:
1
2
3
4
"metadata": {
"semanticCoreLink": "dsl://sales/OrderPolicy",
"sbvrRules": ["order-minimum-value-rule"]
}
Controls define governance requirements applicable to a node:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"controls": [
{
"id": "data-encryption-at-rest",
"description": "All persistent data must be encrypted at rest.",
"status": "compliant"
},
{
"id": "multi-factor-authentication",
"description": "Service authentication requires MFA.",
"status": "non-compliant"
},
{
"id": "penetration-testing-annual",
"description": "Annual penetration testing required.",
"status": "waived",
"waiverReason": "No external exposure"
}
]
Control Status Values:
compliant - Requirement is metnon-compliant - Violation detectedwaived - Exception granted (requires reason)Relationships define how nodes interact with each other.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"relationships": [
{
"id": "order-service-to-customer-db",
"source": "order-service",
"target": "customer-db",
"type": "reads-writes",
"description": "Order service reads and writes customer data.",
"metadata": {
"protocol": "JDBC",
"encryption": "TLS 1.2"
},
"controls": [
{
"id": "access-control-least-privilege",
"description": "Database access must adhere to least privilege principle.",
"status": "compliant"
}
]
}
]
}
| Attribute | Type | Required | Description |
|---|---|---|---|
id |
string | ✅ | Unique identifier |
source |
string | ✅ | ID of originating node |
target |
string | ✅ | ID of destination node |
type |
string | ✅ | Interaction categorization |
description |
string | ❌ | Detailed explanation |
metadata |
object | ❌ | Custom attributes |
controls |
array | ❌ | Governance policies for interaction |
Data Access:
reads - Source reads from targetwrites - Source writes to targetreads-writes - Bidirectional data accessCommunication:
api-call - Synchronous HTTP/REST APImessage-queue - Asynchronous message passingstream - Real-time data streamingevent - Event-driven notificationSEA-Forge™ Extensions:
governs - Source enforces policies on targetinforms - Source provides context to targetgenerates - Source creates instances of targetProtocol & Security:
1
2
3
4
5
6
"metadata": {
"protocol": "HTTPS",
"encryption": "TLS 1.3",
"authentication": "OAuth2",
"authorization": "RBAC"
}
Data Flow:
1
2
3
4
5
6
"metadata": {
"dataFlow": "PII", // Data classification
"dataVolume": "10GB/day",
"latency": "< 100ms",
"sla": "99.9%"
}
Network:
1
2
3
4
5
"metadata": {
"networkZone": "private",
"firewallRule": "fw-rule-123",
"allowedPorts": [443, 8080]
}
Controls for interactions (e.g., data-in-transit encryption):
1
2
3
4
5
6
7
8
9
10
11
12
"controls": [
{
"id": "data-in-transit-encryption",
"description": "All network traffic must use TLS 1.2+",
"status": "compliant"
},
{
"id": "api-rate-limiting",
"description": "External APIs must implement rate limiting",
"status": "non-compliant"
}
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{
"nodes": [
{
"id": "order-service",
"name": "Order Processing Service",
"type": "service",
"description": "Handles customer order creation and management",
"metadata": {
"domain": "Sales",
"team": "Alpha Squad",
"language": "Python",
"deployment": "Kubernetes",
"semanticCoreLink": "dsl://sales/OrderAggregate"
},
"controls": [{ "id": "data-encryption", "status": "compliant" }]
},
{
"id": "customer-db",
"name": "Customer Database",
"type": "database",
"description": "PostgreSQL database storing customer profiles",
"metadata": {
"dataClassification": "PII",
"owner": "Data Governance Team",
"backup": "daily"
},
"controls": [
{ "id": "encryption-at-rest", "status": "compliant" },
{ "id": "access-logging", "status": "compliant" }
]
},
{
"id": "payment-gateway",
"name": "External Payment Gateway",
"type": "external-api",
"description": "Stripe payment processing API",
"metadata": {
"vendor": "Stripe",
"dataFlow": "Financial"
}
}
],
"relationships": [
{
"id": "order-to-customer-db",
"source": "order-service",
"target": "customer-db",
"type": "reads-writes",
"metadata": {
"protocol": "JDBC",
"encryption": "TLS 1.2"
},
"controls": [{ "id": "least-privilege", "status": "compliant" }]
},
{
"id": "order-to-payment",
"source": "order-service",
"target": "payment-gateway",
"type": "api-call",
"metadata": {
"protocol": "HTTPS",
"authentication": "OAuth2",
"dataFlow": "PII,Financial"
},
"controls": [{ "id": "pci-dss-compliance", "status": "compliant" }]
}
]
}
CALM provides architectural context for business concepts:
1
2
3
4
5
6
7
"metadata": {
"semanticCoreLink": "dsl://sales/OrderPolicy",
"implementsRules": [
"order-minimum-value-rule",
"customer-credit-check-rule"
]
}
Linkage:
service → implements SBVR Policyrelationship → realizes SBVR FlowCognitive Layer:
Governance Layer:
CALM serves as blueprint for code generation:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Input: CALM definition
nodes:
- id: user-service
type: service
metadata:
language: Python
framework: FastAPI
# Output: Generated FastAPI project structure
user-service/
├── src/
│ ├── main.py # FastAPI app
│ ├── models/
│ └── routers/
├── tests/
└── Dockerfile
Generation Capabilities:
CALM model transformed into graph representation:
1
2
3
4
5
6
// Nodes become Oxigraph nodes
CREATE (order:Service {id: 'order-service', name: 'Order Processing'})
CREATE (db:Database {id: 'customer-db', type: 'PostgreSQL'})
// Relationships become edges
CREATE (order)-[:READS_WRITES {protocol: 'JDBC'}]->(db)
Query Capabilities:
CALM controls enforced at runtime:
1
2
3
4
5
6
7
"controls": [
{
"id": "rate-limit-100-rps",
"description": "Maximum 100 requests/second",
"status": "compliant"
}
]
Runtime Enforcement:
calm validateValidates architecture against schema and controls:
1
calm validate architecture/payment.calm.json
Checks:
CI/CD Integration:
1
2
3
# .github/workflows/architecture-governance.yml
- name: Validate Architecture
run: calm validate architecture/*.calm.json
calm docifyGenerates documentation from CALM model:
1
calm docify architecture/ --output docs/architecture/
Outputs:
Benefits:
calm generateScaffolds architecture files from templates:
1
calm generate --pattern microservice --name payment-service
Patterns:
Web-based visualization tool:
Features:
URL: https://github.com/finos/architecture-as-code/tree/main/calm-hub
1
2
3
4
5
6
7
8
9
architecture/
├── core/
│ ├── semantic-core.calm.json # DomainForge™ services
│ ├── cognitive-extension.calm.json # SEA™ Core cognitive services
│ └── governance.calm.json # GovernedSpeed™ controls
├── generated/
│ └── vibes-pro.calm.json # Generated apps
└── external/
└── integrations.calm.json # Third-party APIs
Pre-commit Hook:
1
2
#!/bin/bash
calm validate architecture/**/*.calm.json || exit 1
CI Pipeline:
1
2
3
4
test:
script:
- calm validate architecture/
- calm docify --check-only # Ensure docs can be generated
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"controls": [
{
"id": "semantic-core-linkage",
"description": "Service must link to DomainForge™ definition",
"status": "compliant"
},
{
"id": "ai-agent-grounding",
"description": "AI agents must operate within CALM-defined boundaries",
"status": "compliant"
},
{
"id": "hexagonal-architecture",
"description": "Services must follow hexagonal architecture pattern",
"status": "compliant"
}
]
1
2
3
4
5
6
7
8
9
{
"id": "artifact-recommendation-agent",
"type": "ai-agent",
"metadata": {
"baseModel": "GPT-4",
"contextSources": ["knowledge-graph", "user-conversation"],
"governedBy": "sea-core-governance"
}
}
Node IDs: kebab-case (e.g., order-processing-service)
Relationship IDs: source-to-target (e.g., order-to-payment-gateway)
Control IDs: domain-requirement (e.g., pci-dss-encryption)
Start Minimal:
1
2
3
4
"metadata": {
"team": "Alpha Squad",
"language": "Python"
}
Grow as Needed:
1
2
3
4
5
6
7
8
"metadata": {
"team": "Alpha Squad",
"language": "Python",
"deployment": "Kubernetes",
"semanticCoreLink": "dsl://sales/Order",
"sla": "99.9%",
"oncall": "alpha@company.com"
}
1
2
3
4
5
6
7
# Tag architecture versions
git tag -a arch-v1.0.0 -m "Initial e-commerce architecture"
# Branch for experimental designs
git checkout -b feat/add-recommendation-engine
# Update architecture/*.calm.json
calm validate architecture/
Centralize Control Definitions:
1
2
3
4
5
6
7
// controls/security.json
{
"controls": [
{ "id": "encryption-at-rest", "framework": "NIST CSF" },
{ "id": "least-privilege", "framework": "ISO 27001" }
]
}
Reference in CALM:
1
2
3
"controls": [
{"$ref": "controls/security.json#encryption-at-rest", "status": "compliant"}
]
Status: This specification defines CALM DSL usage for SEA-Forge™ Architectural Governance. Implementation should follow FINOS CALM standard with SEA-specific extensions.