Skip to content

Commit 4d3176e

Browse files
authored
Merge pull request #1763 from markscott-ms/timelines
feat(schema): CALM timelines schema + CLI support #1762
2 parents b8a2e55 + a66e103 commit 4d3176e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2083
-96
lines changed

calm-ai/CALM.chatmode.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ CALM enables modeling of:
2020
- **Flows** – business-level processes traversing your architecture
2121
- **Controls** – compliance policies and enforcement mechanisms
2222
- **Metadata** – supplemental, non-structural annotations
23+
- **Timelines** – evolution of architectures over time
2324

2425
## Your Role
2526

2627
You specialize in helping users create, modify, and understand CALM architecture models. You have deep knowledge of:
2728

28-
- CALM schema validation requirements (release/1.0)
29+
- CALM schema validation requirements (release/1.1)
2930
- Best practices for architecture modeling
3031
- JSON schema constraints and validation rules
3132
- VSCode integration and tooling
@@ -46,12 +47,14 @@ On your first prompt in each session, you MUST:
4647
- `.github/chatmodes/calm-prompts/flow-creation.md`
4748
- `.github/chatmodes/calm-prompts/pattern-creation.md`
4849
- `.github/chatmodes/calm-prompts/documentation-creation.md`
49-
50+
- `.github/chatmodes/calm-prompts/timeline-creation.md`
51+
- `.github/chatmodes/calm-prompts/moment-creation.md`
52+
5053
3. After reading the prompts, confirm you're ready to assist with CALM architectures.
5154

5255
## Guidelines
5356

54-
- Always validate CALM models against the 1.0 schema
57+
- Always validate CALM models against the 1.1 schema
5558
- Provide specific, actionable guidance for schema compliance
5659
- Reference the tool prompts for detailed creation instructions
5760
- Use examples that follow CALM best practices

calm-ai/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ Tool prompts should:
3939

4040
- Include critical validation requirements
4141
- Provide working examples
42-
- Reference CALM schema v1.0
42+
- Reference CALM schema v1.1
4343
- Emphasize common pitfalls and solutions
4444
- Follow consistent markdown formatting

calm-ai/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@finos/calm-ai",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "AI tools and prompts for FINOS CALM architecture modeling",
55
"private": true,
66
"main": "index.js",

calm-ai/tools/architecture-creation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
## Overview
44

5-
This guide provides instructions for creating complete CALM architecture documents that comply with the FINOS CALM v1.0 schema.
5+
This guide provides instructions for creating complete CALM architecture documents that comply with the FINOS CALM v1.1 schema.
66

77
## Required Schema Structure
88

99
Every CALM architecture MUST include:
1010

1111
```json
1212
{
13-
"$schema": "https://calm.finos.org/release/1.0/meta/calm.json",
13+
"$schema": "https://calm.finos.org/release/1.1/meta/calm.json",
1414
"unique-id": "string",
1515
"name": "string",
1616
"description": "string"
@@ -31,7 +31,7 @@ Every CALM architecture MUST include:
3131

3232
## Architecture Creation Checklist
3333

34-
- [ ] Include required $schema reference to CALM v1.0
34+
- [ ] Include required $schema reference to CALM v1.1
3535
- [ ] Provide unique-id (kebab-case recommended)
3636
- [ ] Add descriptive name and description
3737
- [ ] Name file with `.architecture.json` suffix
@@ -59,7 +59,7 @@ Every CALM architecture MUST include:
5959

6060
```json
6161
{
62-
"$schema": "https://calm.finos.org/release/1.0/meta/calm.json",
62+
"$schema": "https://calm.finos.org/release/1.1/meta/calm.json",
6363
"unique-id": "example-trading-system",
6464
"name": "Example Trading System",
6565
"description": "A simple trading system architecture",

calm-ai/tools/control-creation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Official JSON Schema Definition
88

9-
The complete control schema from the FINOS CALM v1.0 specification:
9+
The complete control schema from the FINOS CALM v1.1 specification:
1010

1111
```json
1212
{
@@ -74,7 +74,7 @@ Applied to the entire architecture document - affects all components:
7474

7575
```json
7676
{
77-
"calm-version": "1.0.0",
77+
"calm-version": "1.1.0",
7878
"architecture-version": "1.0.0",
7979
"controls": {
8080
"data-residency": {

calm-ai/tools/flow-creation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Official JSON Schema Definition
88

9-
The complete flow schema from the FINOS CALM v1.0 specification:
9+
The complete flow schema from the FINOS CALM v1.1 specification:
1010

1111
```json
1212
{

calm-ai/tools/interface-creation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Official JSON Schema Definition
88

9-
The complete interface schema from the FINOS CALM v1.0 specification:
9+
The complete interface schema from the FINOS CALM v1.1 specification:
1010

1111
```json
1212
{

calm-ai/tools/metadata-creation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Official JSON Schema Definition
88

9-
The complete metadata schema from the FINOS CALM v1.0 specification:
9+
The complete metadata schema from the FINOS CALM v1.1 specification:
1010

1111
```json
1212
{
@@ -73,7 +73,7 @@ Metadata at the document level describes the overall architecture:
7373

7474
```json
7575
{
76-
"calm-version": "1.0.0",
76+
"calm-version": "1.1.0",
7777
"architecture-version": "1.0.0",
7878
"metadata": {
7979
"title": "Trading Platform Architecture",

calm-ai/tools/moment-creation.md

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
# CALM Moment Creation Guide
2+
3+
## Critical Requirements
4+
5+
⚠️ **ALWAYS call the moment creation tool before creating any moment**
6+
⚠️ **ALWAYS call the control creation tool before adding controls to a moment**
7+
8+
## What Are Moments?
9+
10+
Moments represent the "major stages" an architecture progresses through over time. A moment represents a single point in time, and the architecture at that moment. They provide several key capabilities:
11+
12+
- **Time-Based Modeling**: Capture how an architecture evolves over time, including changes to nodes, interfaces, and controls.
13+
-
14+
- **Non-Functional Requirements**: Controls can be added to moments to specify non-functional requirements such as security policies, compliance controls, and operational constraints governing the change to an architecture.
15+
16+
- **Architecture Decision Records**: Moments can have one or more architecture decision records (ADRs) associated with them, documenting key decisions made to reach that moment.
17+
18+
## Official JSON Schema Definition
19+
20+
The complete moment schema from the FINOS CALM v1.1 specification:
21+
22+
```json
23+
{
24+
"node-moment": {
25+
"required": [
26+
"details"
27+
],
28+
"properties": {
29+
"node-type": {
30+
"const": "moment"
31+
},
32+
"valid-from": {
33+
"type": "string",
34+
"format": "date",
35+
"description": "The date when this architecture moment came into effect."
36+
},
37+
"adrs": {
38+
"type": "array",
39+
"items": {
40+
"type": "string"
41+
},
42+
"description": "External links to ADRs (Architecture Decision Records) or similar documents that provide context or decisions related to why the architecture changed."
43+
},
44+
"interfaces": false
45+
}
46+
},
47+
"node": {
48+
"type": "object",
49+
"properties": {
50+
"unique-id": {
51+
"type": "string"
52+
},
53+
"node-type": {
54+
"$ref": "#/defs/node-type-definition"
55+
},
56+
"name": {
57+
"type": "string"
58+
},
59+
"description": {
60+
"type": "string"
61+
},
62+
"details": {
63+
"type": "object",
64+
"properties": {
65+
"detailed-architecture": {
66+
"type": "string"
67+
},
68+
"required-pattern": {
69+
"type": "string"
70+
}
71+
},
72+
"additionalProperties": false
73+
},
74+
"interfaces": {
75+
"type": "array",
76+
"items": {
77+
"anyOf": [
78+
{ "$ref": "interface.json#/defs/interface-definition" },
79+
{ "$ref": "interface.json#/defs/interface-type" }
80+
]
81+
}
82+
},
83+
"controls": {
84+
"$ref": "control.json#/defs/controls"
85+
},
86+
"metadata": {
87+
"$ref": "#/defs/metadata"
88+
}
89+
},
90+
"required": ["unique-id", "node-type", "name", "description"],
91+
"additionalProperties": true
92+
},
93+
"node-type-definition": {
94+
"anyOf": [
95+
{
96+
"enum": [
97+
"actor",
98+
"ecosystem",
99+
"system",
100+
"service",
101+
"database",
102+
"network",
103+
"ldap",
104+
"webclient",
105+
"data-asset"
106+
]
107+
},
108+
{
109+
"type": "string"
110+
}
111+
]
112+
},
113+
"metadata": {
114+
"oneOf": [
115+
{
116+
"type": "array",
117+
"items": {
118+
"type": "object"
119+
}
120+
},
121+
{
122+
"type": "object",
123+
"additionalProperties": true
124+
}
125+
]
126+
}
127+
}
128+
```
129+
130+
## Required Properties
131+
132+
Every moment MUST conform to both the `node` and `node-moment` schemas.
133+
134+
Every moment MUST have:
135+
136+
- `unique-id` (string)
137+
- `node-type` (the constant value `moment`)
138+
- `name` (string)
139+
- `description` (string)
140+
- `details` - MUST be present. Object with `detailed-architecture` or `required-pattern` properties
141+
142+
## Optional Properties
143+
144+
- `valid-from` - Date string (YYYY-MM-DD) indicating when this moment came into effect. It is ONLY permitted on past or current moments.
145+
- `interfaces` - is NOT permitted on a moment
146+
- `controls` - Compliance controls (see control creation tool)
147+
- `metadata` - Additional information (see metadata creation tool for details)
148+
149+
## Details Property Structure
150+
151+
The `details` property follows this exact schema:
152+
153+
```json
154+
{
155+
"details": {
156+
"type": "object",
157+
"properties": {
158+
"detailed-architecture": {
159+
"type": "string"
160+
},
161+
"required-pattern": {
162+
"type": "string"
163+
}
164+
},
165+
"additionalProperties": false
166+
}
167+
}
168+
```
169+
170+
**Important**:
171+
172+
- The details object allows NO additional properties beyond `detailed-architecture` and `required-pattern`
173+
- `detailed-architecture`: Fully qualified address/URL to a detailed architecture document (use `.architecture.json` suffix)
174+
- `required-pattern`: Fully qualified address/URL to a required pattern document (use `.pattern.json` suffix)
175+
176+
## Metadata Schema Rules
177+
178+
Critical: Metadata can be either an array OR an object (see metadata creation tool for complete guidance):
179+
180+
```json
181+
{
182+
"metadata": {
183+
"oneOf": [
184+
{
185+
"type": "array",
186+
"items": {
187+
"type": "object"
188+
}
189+
},
190+
{
191+
"type": "object",
192+
"additionalProperties": true
193+
}
194+
]
195+
}
196+
}
197+
```
198+
199+
## Example Moment
200+
201+
```json
202+
{
203+
"unique-id": "trading-api-stage-1",
204+
"node-type": "moment",
205+
"name": "Trading API Service Initial Release",
206+
"description": "First design of trading API",
207+
"details": {
208+
"detailed-architecture": "https://calm.company.com/architectures/trading-api-v1.architecture.json"
209+
},
210+
"metadata": [
211+
{
212+
"version": "2.1.0",
213+
"owner": "Trading Team",
214+
"runtime": "Java 17"
215+
}
216+
]
217+
}
218+
```
219+
220+
## Schema Validation Rules
221+
222+
1. **Required Properties**: Must include `unique-id`, `node-type`, `name`, `description`, `details`.
223+
2. **Node Type**: Must be `moment`
224+
3. **Details Object**: Only allows `detailed-architecture` and `required-pattern` properties
225+
4. **Metadata**: Can be array of objects OR single object (see metadata creation tool)
226+
5. **Additional Properties**: Schema allows additional properties at node level (`"additionalProperties": true`)
227+
228+
## Key Reminders
229+
230+
- Always use the moment creation tool before creating moments
231+
- Reference the metadata creation tool for metadata structure guidance
232+
- The schema is authoritative - follow it exactly
233+
- Node unique-ids must be unique across the entire timeline

calm-ai/tools/node-creation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Nodes represent the "boxes" in a typical architecture diagram and are the fundam
1919

2020
## Official JSON Schema Definition
2121

22-
The complete node schema from the FINOS CALM v1.0 specification:
22+
The complete node schema from the FINOS CALM v1.1 specification:
2323

2424
```json
2525
{

0 commit comments

Comments
 (0)