-
Notifications
You must be signed in to change notification settings - Fork 93
Description
Bug Report
A pattern file created by the CALM AI Assistant does not pass calm validate
Steps to Reproduce:
calm init-ai -p copilot- Prompt the AI Assistant
show me a pattern for a three-tiered web application. Do not create a file. - Copy/paste the sample pattern file displayed into a file
three-tiered-webapp-example.architecture.json - run
calm validate -p three-tiered-webapp-example.architecture.json
Expected Result:
Expected to see the pattern file created by the AI Assistant to pass validation.
Actual Result:
I see the following error
calm validate -p three-tier-webapp-example.architecture.json
info [calm-validate]: Formatting output as json
{
"jsonSchemaValidationOutputs": [
{
"code": "json-schema",
"severity": "error",
"message": "AnySchema https://calm.finos.org/release/1.2/meta/interface.json is loaded but https://calm.finos.org/release/1.2/meta/interface.json#/defs/url-interface cannot be resolved",
"path": "/",
"source": "pattern"
}
],
"spectralSchemaValidationOutputs": [],
"hasErrors": true,
"hasWarnings": false
Environment:
MacOS: 15.7.3
calm cli: 1.33.0
VSCode: 1.109.2
Github Copilot Chat Extension: 0.37.5
Additional Context:
In looking at the AI Assistant generated pattern, I see references such as
"$ref": "https://calm.finos.org/release/1.2/meta/interface.json#/defs/url-interface"
"$ref": "https://calm.finos.org/release/1.2/meta/interface.json#/defs/port-interface"
In looking at the 1.2 schema for interfaces: https://github.com/finos/architecture-as-code/blob/main/calm/release/1.2/meta/interface.json I only see these defs
interface-definition:"interface-definition": { interface-type:"interface-type": { node-interface:"node-interface": {
I don't see url-interface nor port-interface. From what I can tell these defs are found only in schema 1.0-rc1.
It appears that some of the few shot examples prompt instructions in calm-ai/tools/create-pattern.md may not have been updated as the CALM schema evolved.
If this is a correct interpretation of the content, I'm willing to create a pull request to update the erroneous defs to comply with the 1.2 schema.
For the record here is the pattern file created by the AI Assistant
{
"$schema": "https://calm.finos.org/release/1.2/meta/calm.json",
"$id": "https://example.com/patterns/three-tier-webapp.pattern.json",
"title": "Three-Tier Web Application Pattern",
"description": "A standard three-tier architecture with web frontend, application server, and database",
"type": "object",
"properties": {
"nodes": {
"type": "array",
"minItems": 3,
"maxItems": 3,
"prefixItems": [
{
"$ref": "https://calm.finos.org/release/1.2/meta/core.json#/defs/node",
"type": "object",
"properties": {
"unique-id": { "const": "web-frontend" },
"name": { "const": "Web Frontend" },
"node-type": { "const": "webclient" },
"description": { "type": "string" },
"interfaces": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"prefixItems": [
{
"$ref": "https://calm.finos.org/release/1.2/meta/interface.json#/defs/url-interface",
"properties": {
"unique-id": { "const": "frontend-url" }
}
}
]
}
},
"required": ["description"]
},
{
"$ref": "https://calm.finos.org/release/1.2/meta/core.json#/defs/node",
"type": "object",
"properties": {
"unique-id": { "const": "application-server" },
"name": { "const": "Application Server" },
"node-type": { "const": "service" },
"description": { "type": "string" },
"interfaces": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"prefixItems": [
{
"$ref": "https://calm.finos.org/release/1.2/meta/interface.json#/defs/port-interface",
"properties": {
"unique-id": { "const": "app-api-port" }
}
}
]
}
},
"required": ["description"]
},
{
"$ref": "https://calm.finos.org/release/1.2/meta/core.json#/defs/node",
"type": "object",
"properties": {
"unique-id": { "const": "database" },
"name": { "const": "Database Server" },
"node-type": { "const": "database" },
"description": { "type": "string" },
"interfaces": {
"type": "array",
"minItems": 1,
"maxItems": 1,
"prefixItems": [
{
"$ref": "https://calm.finos.org/release/1.2/meta/interface.json#/defs/port-interface",
"properties": {
"unique-id": { "const": "db-port" }
}
}
]
}
},
"required": ["description"]
}
]
},
"relationships": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"prefixItems": [
{
"$ref": "https://calm.finos.org/release/1.2/meta/core.json#/defs/relationship",
"type": "object",
"properties": {
"unique-id": { "const": "frontend-to-app" },
"description": { "type": "string" },
"protocol": { "const": "HTTPS" },
"relationship-type": {
"const": {
"connects": {
"source": { "node": "web-frontend" },
"destination": { "node": "application-server" }
}
}
}
},
"required": ["description"]
},
{
"$ref": "https://calm.finos.org/release/1.2/meta/core.json#/defs/relationship",
"type": "object",
"properties": {
"unique-id": { "const": "app-to-database" },
"description": { "type": "string" },
"protocol": { "const": "JDBC" },
"relationship-type": {
"const": {
"connects": {
"source": { "node": "application-server" },
"destination": { "node": "database" }
}
}
}
},
"required": ["description"]
}
]
}
},
"required": ["nodes", "relationships"]
}Metadata
Metadata
Assignees
Labels
Type
Projects
Status