Summary
The current metadata schema has limitations that constrain how structured data can be stored on diagram cells and other TMI objects.
Approved Design Direction
After analysis, the approved approach is:
value field becomes type: array, items: {type: string} — always an array, even for single values
- DB stores JSON arrays in the value column — one-time migration converts existing plain strings to single-element JSON arrays
- Widen DB column from
varchar(1024) to varchar(4096)
- Validation: max 1024 bytes per individual string, max 4096 bytes total for the serialized array
- MinimalNode/MinimalEdge flattening: join array values with a delimiter for WebSocket
- Breaking change: existing clients (tmi-ux) must update to send/receive arrays
- No change to maxItems on any entity type
Open Question
- Should the field be renamed from
value to values since it is always an array?
Context
The tmi-tf Terraform analyzer stores component dependencies, security controls, and other structured data as metadata on diagram cells. With the current constraints, flat arrays of strings must be serialized as JSON-in-a-string or numbered key suffixes (dependency01-name, dependency02-name), which is fragile and not human-readable.
Current Schema
From tmi-openapi.json:
- Key: maxLength 256, pattern
^[a-zA-Z0-9_./:-]+$
- Value: maxLength 1024, minLength 1
- Both required strings
Summary
The current metadata schema has limitations that constrain how structured data can be stored on diagram cells and other TMI objects.
Approved Design Direction
After analysis, the approved approach is:
valuefield becomestype: array, items: {type: string}— always an array, even for single valuesvarchar(1024)tovarchar(4096)Open Question
valuetovaluessince it is always an array?Context
The
tmi-tfTerraform analyzer stores component dependencies, security controls, and other structured data as metadata on diagram cells. With the current constraints, flat arrays of strings must be serialized as JSON-in-a-string or numbered key suffixes (dependency01-name,dependency02-name), which is fragile and not human-readable.Current Schema
From
tmi-openapi.json:^[a-zA-Z0-9_./:-]+$