The .sgm format
A .sgm file is a versioned JSON envelope around a Strata Graph Model.
Envelope
json
{
"format": "strata-graph-model",
"version": 2,
"model": { "meta": {}, "sections": [], "nodes": [], "edges": [] }
}formatmust be"strata-graph-model". A file without it is rejected.versionis the format version (currently2). A newer version than the build understands is rejected rather than misread. Aversion: 1file still opens: its node positions are migrated on import.modelis the graph itself.
The model
ts
meta: { name: string; base: string } // base: id of the built-in it derives from, or "custom"
sections: { id, label, hue, order }[]
nodes: { id, label, kind, sectionId?, origin, status?, files?, note?,
createdAt?, dueAt?, locked?, position? }[]
edges: { id, source, target, kind, origin, via? }[]kindis"section" | "doc" | "comment"for nodes,"dependency" | "comment"for edges.originis"auto"(from the built-in model or scan) or"manual"(added by you).statusis"generated" | "missing" | "unavailable".sourceis the prerequisite;targetdepends on it.createdAtanddueAtare epoch milliseconds;lockedprevents dragging.positionfor a document or central node is relative to its band origin (formatversion: 2); a comment or sectionless node keeps absolute canvas coordinates.
Validation
On import, Strata parses the JSON, checks the format and version, and verifies the model has meta, sections, nodes and edges. Any failure raises a clear error and the current graph is kept.