UML Sequence

How one edit on the canvas becomes a delta the web app merges, relays and records

UML Sequence
Figure 6. UML Sequence
Diagram source
Diagram JSON
{
  "shapes": [
    {
      "shapes": [],
      "id": "md-dvaeh9~e1794205990408",
      "category": "Always available",
      "type": "markdown",
      "props": {
        "markdown": "# Explanation\n\nThe prompt:\n\n> Create me a sequence diagram, with no more than 10-15 calls in it showing how an edit translates into a delta that is recorded in the webapp. Put in some duration constraints, and a execution bar or 2 and use color.",
        "fill": "#ffffff",
        "outline": "#d0d7de",
        "magnification": 1
      },
      "smZ": null,
      "smTab": null,
      "fileLink": null,
      "fileLinkDesc": null,
      "smGroup": null,
      "deleted": false,
      "x": 431,
      "y": 1010,
      "w": 488,
      "h": 230
    },
    {
      "shapes": [],
      "id": "you~e1794205896994",
      "category": "Sequence diagram",
      "type": "lifeline",
      "props": {
        "name": "you:Person",
        "stereotype": "",
        "classifier": "actor",
        "destroyed": false,
        "color": 6
      },
      "smZ": null,
      "smTab": null,
      "fileLink": null,
      "fileLinkDesc": null,
      "smGroup": null,
      "deleted": false,
      "x": 40,
      "y": 70,
      "w": null,
      "h": 871
    },
    {
      "shapes": [
        {
          "id": "link-ai-2~e1794205896995",
          "category": "Sequence diagram",
          "type": "message",
          "props": {
            "kind": "sync",
            "name": "markDirty(cell) · armAutosave()",
            "stereotype": "",
            "y": 214
          },
          "smZ": null,
          "smTab": null,
          "fileLink": null,
          "fileLinkDesc": null,
          "smGroup": null,
          "deleted": false,
          "source": "canvas~e1794205896995",
          "target": "canvas~e1794205896995",
          "vertices": [],
          "straight": false,
          "bezier": false,
          "noAvoid": null,
          "vrel": false,
          "labMove": false,
          "labOff": {},
          "subtitle": null,
          "description": "Every graph event marks its cell dirty and re-arms a 400 ms debounce, so a burst of events becomes one capture.",
          "animation": null
        }
      ],
      "id": "canvas~e1794205896995",
      "category": "Sequence diagram",
      "type": "lifeline",
      "props": {
        "name": ":Canvas",
        "stereotype": "autosave.js",
        "classifier": "boundary",
        "destroyed": false,
        "color": 1
      },
      "smZ": null,
      "smTab": null,
      "fileLink": "packages/drawcore/src/modebit/drawcore/js_domain/autosave.js",
      "fileLinkDesc": "markDirty and the 400 ms autosave debounce that turns graph events into one capture.",
      "smGroup": null,
      "deleted": false,
      "x": 180,
      "y": 70,
      "w": null,
      "h": 871
    },
    {
      "shapes": [],
      "id": "history~e1794205896996",
      "category": "Sequence diagram",
      "type": "lifeline",
      "props": {
        "name": ":History",
        "stereotype": "view.js",
        "classifier": "control",
        "destroyed": false,
        "color": 1
      },
      "smZ": null,
      "smTab": null,
      "fileLink": "packages/drawcore/src/modebit/drawcore/js_domain/view.js",
      "fileLinkDesc": "recordStep: the full diff of baseModel against the live model that becomes one undo step.",
      "smGroup": null,
      "deleted": false,
      "x": 320,
      "y": 70,
      "w": null,
      "h": 871
    },
    {
      "shapes": [
        {
          "id": "link-ai-6~e1794205896995",
          "category": "Sequence diagram",
          "type": "message",
          "props": {
            "kind": "sync",
            "name": "computeDelta()",
            "stereotype": "",
            "y": 418
          },
          "smZ": null,
          "smTab": null,
          "fileLink": null,
          "fileLinkDesc": null,
          "smGroup": null,
          "deleted": false,
          "source": "dsync~e1794205896997",
          "target": "dsync~e1794205896997",
          "vertices": [],
          "straight": false,
          "bezier": false,
          "noAvoid": null,
          "vrel": false,
          "labMove": false,
          "labOff": {},
          "subtitle": null,
          "description": "computeDelta(keys, getModel()) → {upserts, removes}. Each upsert names the fields it changed (field-level sync) and carries the whole item for older servers.",
          "animation": null
        }
      ],
      "id": "dsync~e1794205896997",
      "category": "Sequence diagram",
      "type": "lifeline",
      "props": {
        "name": ":DeltaSync",
        "stereotype": "deltasync.js",
        "classifier": "control",
        "destroyed": false,
        "color": 1
      },
      "smZ": null,
      "smTab": null,
      "fileLink": "packages/drawcore/src/modebit/drawcore/js_domain/deltasync.js",
      "fileLinkDesc": "computeDelta, the apply_delta call over the WebSocket, and applying a relayed delta.",
      "smGroup": null,
      "deleted": false,
      "x": 460,
      "y": 70,
      "w": null,
      "h": 871
    },
    {
      "shapes": [],
      "id": "ws~e1794205896998",
      "category": "Sequence diagram",
      "type": "lifeline",
      "props": {
        "name": ":WS API",
        "stereotype": "ws_api",
        "classifier": "boundary",
        "destroyed": false,
        "color": 0
      },
      "smZ": null,
      "smTab": null,
      "fileLink": "packages/drawcore/src/modebit/drawcore/ws_api/methods.py",
      "fileLinkDesc": "apply_delta: merges the delta into the canonical, relays it to the other canvases and records who made it.",
      "smGroup": null,
      "deleted": false,
      "x": 614,
      "y": 70,
      "w": null,
      "h": 871
    },
    {
      "shapes": [
        {
          "id": "link-ai-9~e1794205896995",
          "category": "Sequence diagram",
          "type": "message",
          "props": {
            "kind": "sync",
            "name": "seq += 1",
            "stereotype": "",
            "y": 547
          },
          "smZ": null,
          "smTab": null,
          "fileLink": null,
          "fileLinkDesc": null,
          "smGroup": null,
          "deleted": false,
          "source": "canon~e1794205896999",
          "target": "canon~e1794205896999",
          "vertices": [],
          "straight": false,
          "bezier": false,
          "noAvoid": null,
          "vrel": false,
          "labMove": false,
          "labOff": {},
          "subtitle": null,
          "description": "seq orders every relay: a client drops anything at or below its lastSeq and reloads on a gap.",
          "animation": null
        }
      ],
      "id": "canon~e1794205896999",
      "category": "Sequence diagram",
      "type": "lifeline",
      "props": {
        "name": ":Canonical",
        "stereotype": "Redis",
        "classifier": "entity",
        "destroyed": false,
        "color": 0
      },
      "smZ": null,
      "smTab": null,
      "fileLink": "packages/drawcore/src/modebit/drawcore/team/redis_team_updates.py",
      "fileLinkDesc": "The live canonical on the web: one getModel-shaped dict per diagram, shared by every replica.",
      "smGroup": null,
      "deleted": false,
      "x": 754,
      "y": 70,
      "w": null,
      "h": 871
    },
    {
      "shapes": [],
      "id": "reg~e1794205897000",
      "category": "Sequence diagram",
      "type": "lifeline",
      "props": {
        "name": ":Register",
        "stereotype": "modifications",
        "classifier": "entity",
        "destroyed": false,
        "color": 4
      },
      "smZ": null,
      "smTab": null,
      "fileLink": "packages/aicore/src/modebit/aicore/modifications.py",
      "fileLinkDesc": "The modification register: whose work, which shapes it touched, and why.",
      "smGroup": null,
      "deleted": false,
      "x": 894,
      "y": 70,
      "w": null,
      "h": 871
    },
    {
      "shapes": [],
      "id": "store~e1794205897001",
      "category": "Sequence diagram",
      "type": "lifeline",
      "props": {
        "name": ":Store",
        "stereotype": "Postgres",
        "classifier": "database",
        "destroyed": false,
        "color": 4
      },
      "smZ": null,
      "smTab": null,
      "fileLink": null,
      "fileLinkDesc": null,
      "smGroup": null,
      "deleted": false,
      "x": 1042,
      "y": 70,
      "w": null,
      "h": 871
    },
    {
      "shapes": [
        {
          "id": "link-ai-12~e1794205896995",
          "category": "Sequence diagram",
          "type": "message",
          "props": {
            "kind": "sync",
            "name": "applyDeltaMerged()",
            "stereotype": "",
            "y": 703
          },
          "smZ": null,
          "smTab": null,
          "fileLink": null,
          "fileLinkDesc": null,
          "smGroup": null,
          "deleted": false,
          "source": "mate~e1794205897002",
          "target": "mate~e1794205897002",
          "vertices": [],
          "straight": false,
          "bezier": false,
          "noAvoid": null,
          "vrel": false,
          "labMove": false,
          "labOff": {},
          "subtitle": null,
          "description": "Absorbed into the teammate's baseModel first, so it never shows up in their own next undo step; their dragged or unsent cells are shielded.",
          "animation": null
        }
      ],
      "id": "mate~e1794205897002",
      "category": "Sequence diagram",
      "type": "lifeline",
      "props": {
        "name": "teammate:Canvas",
        "stereotype": "browser",
        "classifier": "boundary",
        "destroyed": false,
        "color": 1
      },
      "smZ": null,
      "smTab": null,
      "fileLink": "packages/drawcore/src/modebit/drawcore/js_domain/deltasync.js",
      "fileLinkDesc": "applyDelta: seq-gated, then merged around the teammate's own unsent edits.",
      "smGroup": null,
      "deleted": false,
      "x": 1188,
      "y": 70,
      "w": null,
      "h": 871
    },
    {
      "shapes": [],
      "id": "deb~e1794205897003",
      "category": "Sequence diagram",
      "type": "execution",
      "props": {
        "kind": "duration",
        "lifeline": "canvas~e1794205896995",
        "label": "{400 ms}",
        "color": 3
      },
      "smZ": null,
      "smTab": null,
      "fileLink": null,
      "fileLinkDesc": null,
      "smGroup": null,
      "deleted": false,
      "x": 228,
      "y": 214,
      "w": null,
      "h": 68
    },
    {
      "shapes": [
        {
          "id": "link-ai-4~e1794205896995",
          "category": "Sequence diagram",
          "type": "message",
          "props": {
            "kind": "sync",
            "name": "diff()",
            "stereotype": "",
            "y": 312
          },
          "smZ": null,
          "smTab": null,
          "fileLink": null,
          "fileLinkDesc": null,
          "smGroup": null,
          "deleted": false,
          "source": "hbar~e1794205897004",
          "target": "hbar~e1794205897004",
          "vertices": [],
          "straight": false,
          "bezier": false,
          "noAvoid": null,
          "vrel": false,
          "labMove": false,
          "labOff": {},
          "subtitle": null,
          "description": "A FULL diff of the anchor against the live model: everything that changed, cascades included, lands in ONE step. A teammate's relayed changes were absorbed into baseModel, so only mine remain.",
          "animation": null
        }
      ],
      "id": "hbar~e1794205897004",
      "category": "Sequence diagram",
      "type": "execution",
      "props": {
        "kind": "execution",
        "lifeline": "history~e1794205896996",
        "label": "",
        "color": 1
      },
      "smZ": null,
      "smTab": null,
      "fileLink": null,
      "fileLinkDesc": null,
      "smGroup": null,
      "deleted": false,
      "x": 359,
      "y": 274,
      "w": null,
      "h": 110
    },
    {
      "shapes": [],
      "id": "wbar~e1794205897005",
      "category": "Sequence diagram",
      "type": "execution",
      "props": {
        "kind": "execution",
        "lifeline": "ws~e1794205896998",
        "label": "",
        "color": 0
      },
      "smZ": null,
      "smTab": null,
      "fileLink": null,
      "fileLinkDesc": null,
      "smGroup": null,
      "deleted": false,
      "x": 649,
      "y": 463,
      "w": null,
      "h": 367
    },
    {
      "shapes": [],
      "id": "savedur~e1794206457236",
      "category": "Sequence diagram",
      "type": "execution",
      "props": {
        "kind": "duration",
        "lifeline": "store~e1794205897001",
        "label": "{≤ 5 s}",
        "color": 14
      },
      "smZ": null,
      "smTab": null,
      "fileLink": null,
      "fileLinkDesc": null,
      "smGroup": null,
      "deleted": false,
      "x": 1079,
      "y": 868,
      "w": null,
      "h": 42
    },
    {
      "shapes": [],
      "id": "sd~e1794205896992",
      "category": "Sequence diagram",
      "type": "fragment",
      "props": {
        "op": "sd",
        "label": "Edit → delta → recorded",
        "color": 7,
        "bodyColor": -1
      },
      "smZ": 5,
      "smTab": null,
      "fileLink": null,
      "fileLinkDesc": null,
      "smGroup": null,
      "deleted": false,
      "x": 0,
      "y": 0,
      "w": 1360,
      "h": 957
    },
    {
      "shapes": [],
      "id": "par~e1794205896993",
      "category": "Sequence diagram",
      "type": "fragment",
      "props": {
        "op": "par",
        "label": "",
        "color": 0,
        "bodyColor": 0,
        "operands": [
          [
            101,
            ""
          ]
        ]
      },
      "smZ": 4,
      "smTab": null,
      "fileLink": null,
      "fileLinkDesc": null,
      "smGroup": null,
      "deleted": false,
      "x": 599,
      "y": 638,
      "w": 731,
      "h": 154
    },
    {
      "id": "link-ai-10~e1794205896995",
      "category": "Sequence diagram",
      "type": "message",
      "props": {
        "kind": "reply",
        "name": "merged items · seq",
        "stereotype": "",
        "y": 605
      },
      "smZ": null,
      "smTab": null,
      "fileLink": null,
      "fileLinkDesc": null,
      "smGroup": null,
      "deleted": false,
      "source": "canon~e1794205896999",
      "target": "wbar~e1794205897005",
      "vertices": [],
      "straight": false,
      "bezier": false,
      "noAvoid": null,
      "vrel": false,
      "labMove": false,
      "labOff": {},
      "subtitle": null,
      "description": null,
      "animation": null
    },
    {
      "id": "link-ai-11~e1794205896995",
      "category": "Sequence diagram",
      "type": "message",
      "props": {
        "kind": "async",
        "name": "relay(merged, seq)",
        "stereotype": "",
        "y": 661
      },
      "smZ": null,
      "smTab": null,
      "fileLink": null,
      "fileLinkDesc": null,
      "smGroup": null,
      "deleted": false,
      "source": "wbar~e1794205897005",
      "target": "mate~e1794205897002",
      "vertices": [],
      "straight": false,
      "bezier": false,
      "noAvoid": null,
      "vrel": false,
      "labMove": false,
      "labOff": {},
      "subtitle": "targeted · never back to the sender",
      "description": "Targeted, not broadcast: only the sockets with this diagram open, minus the sender — and it relays what it STORED, not what was sent.",
      "animation": {
        "kind": "balls",
        "color": "#3f8f6b",
        "spacing": 60,
        "speed": 90
      }
    },
    {
      "id": "link-ai-13~e1794205896995",
      "category": "Sequence diagram",
      "type": "message",
      "props": {
        "kind": "async",
        "name": "record(source, touched)",
        "stereotype": "",
        "y": 763
      },
      "smZ": null,
      "smTab": null,
      "fileLink": "packages/drawmode/src/modebit/drawmode/modification_hooks.py",
      "fileLinkDesc": "changed(): files a canvas edit in the register under its source.",
      "smGroup": null,
      "deleted": false,
      "source": "wbar~e1794205897005",
      "target": "reg~e1794205897000",
      "vertices": [],
      "straight": false,
      "bezier": false,
      "noAvoid": null,
      "vrel": false,
      "labMove": false,
      "labOff": {},
      "subtitle": "who · which shapes · why",
      "description": "The source is known where the change is made: person~tab for a canvas. The register keeps whose work it was and which shapes it touched; the why is the annotation on the row.",
      "animation": null
    },
    {
      "id": "link-ai-14~e1794205896995",
      "category": "Sequence diagram",
      "type": "message",
      "props": {
        "kind": "reply",
        "name": "ack(seq)",
        "stereotype": "",
        "y": 822
      },
      "smZ": null,
      "smTab": null,
      "fileLink": null,
      "fileLinkDesc": null,
      "smGroup": null,
      "deleted": false,
      "source": "wbar~e1794205897005",
      "target": "dsync~e1794205896997",
      "vertices": [],
      "straight": false,
      "bezier": false,
      "noAvoid": null,
      "vrel": false,
      "labMove": false,
      "labOff": {},
      "subtitle": null,
      "description": null,
      "animation": null
    },
    {
      "id": "link-ai-15~e1794205896995",
      "category": "Sequence diagram",
      "type": "message",
      "props": {
        "kind": "async",
        "name": "save()",
        "stereotype": "",
        "y": 873,
        "slope": 42
      },
      "smZ": null,
      "smTab": null,
      "fileLink": null,
      "fileLinkDesc": null,
      "smGroup": null,
      "deleted": false,
      "source": "canon~e1794205896999",
      "target": "store~e1794205897001",
      "vertices": [],
      "straight": false,
      "bezier": false,
      "noAvoid": null,
      "vrel": false,
      "labMove": false,
      "labOff": {},
      "subtitle": null,
      "description": "The store write is held to one per diagram per 5 s on the web and writes the shared copy as it stands — the delta is durable from here.",
      "animation": null
    },
    {
      "id": "link-ai-1~e1794205896995",
      "category": "Sequence diagram",
      "type": "message",
      "props": {
        "kind": "sync",
        "name": "drag & drop a shape",
        "stereotype": "",
        "y": 172
      },
      "smZ": null,
      "smTab": null,
      "fileLink": null,
      "fileLinkDesc": null,
      "smGroup": null,
      "deleted": false,
      "source": "you~e1794205896994",
      "target": "canvas~e1794205896995",
      "vertices": [],
      "straight": false,
      "bezier": false,
      "noAvoid": null,
      "vrel": false,
      "labMove": false,
      "labOff": {},
      "subtitle": null,
      "description": null,
      "animation": null
    },
    {
      "id": "link-ai-3~e1794205896995",
      "category": "Sequence diagram",
      "type": "message",
      "props": {
        "kind": "sync",
        "name": "recordStep()",
        "stereotype": "",
        "y": 282
      },
      "smZ": null,
      "smTab": null,
      "fileLink": null,
      "fileLinkDesc": null,
      "smGroup": null,
      "deleted": false,
      "source": "canvas~e1794205896995",
      "target": "hbar~e1794205897004",
      "vertices": [],
      "straight": false,
      "bezier": false,
      "noAvoid": null,
      "vrel": false,
      "labMove": false,
      "labOff": {},
      "subtitle": null,
      "description": "When the debounce fires (or Cmd-Z flushes it) the canvas asks for one undo step.",
      "animation": null
    },
    {
      "id": "link-ai-5~e1794205896995",
      "category": "Sequence diagram",
      "type": "message",
      "props": {
        "kind": "sync",
        "name": "postModel(step.keys)",
        "stereotype": "",
        "y": 376
      },
      "smZ": null,
      "smTab": null,
      "fileLink": null,
      "fileLinkDesc": null,
      "smGroup": null,
      "deleted": false,
      "source": "hbar~e1794205897004",
      "target": "dsync~e1794205896997",
      "vertices": [],
      "straight": false,
      "bezier": false,
      "noAvoid": null,
      "vrel": false,
      "labMove": false,
      "labOff": {},
      "subtitle": "one undo step = one delta",
      "description": "The step's own keys are exactly what is sent as the sync delta.",
      "animation": null
    },
    {
      "id": "link-ai-7~e1794205896995",
      "category": "Sequence diagram",
      "type": "message",
      "props": {
        "kind": "async",
        "name": "apply_delta(delta)",
        "stereotype": "",
        "y": 484
      },
      "smZ": null,
      "smTab": null,
      "fileLink": null,
      "fileLinkDesc": null,
      "smGroup": null,
      "deleted": false,
      "source": "dsync~e1794205896997",
      "target": "wbar~e1794205897005",
      "vertices": [],
      "straight": false,
      "bezier": false,
      "noAvoid": null,
      "vrel": false,
      "labMove": false,
      "labOff": {},
      "subtitle": "WebSocket",
      "description": "The delta crosses to the server. A failed send retries once, recomputed from the live model; persistent failure converges through reconcile.",
      "animation": {
        "kind": "balls",
        "color": "#4e81fe",
        "spacing": 60,
        "speed": 90
      }
    },
    {
      "id": "link-ai-8~e1794205896995",
      "category": "Sequence diagram",
      "type": "message",
      "props": {
        "kind": "sync",
        "name": "merge_delta()",
        "stereotype": "",
        "y": 520
      },
      "smZ": null,
      "smTab": null,
      "fileLink": "packages/drawcore/src/modebit/drawcore/team/delta.py",
      "fileLinkDesc": "merge_delta: the one field-level apply the canonical, caches and pages share.",
      "smGroup": null,
      "deleted": false,
      "source": "wbar~e1794205897005",
      "target": "canon~e1794205896999",
      "vertices": [],
      "straight": false,
      "bezier": false,
      "noAvoid": null,
      "vrel": false,
      "labMove": false,
      "labOff": {},
      "subtitle": "under the diagram's lock",
      "description": "Only the named fields of each stored item change; a field the item lacks is cleared — a bucket's update is total.",
      "animation": null
    }
  ],
  "id": "d91b11cce",
  "name": "UML Sequence",
  "category": "sequence",
  "description": "How one edit on the canvas becomes a delta the web app merges, relays and records",
  "tags": [],
  "order": null,
  "publish_ignore": false,
  "ai_guidance": "",
  "deleted": false,
  "open": false,
  "view": {},
  "stamp": {
    "epoch": 0.0,
    "user": "",
    "nonce": 0
  },
  "touched_ms": 0.0,
  "last_editor": "",
  "schema_version": 1,
  "variables": [],
  "projection": ""
}
Pure model
{
  "elements": [
    {
      "id": "md-dvaeh9~e1794205990408",
      "category": "Notes",
      "kind": "markdown",
      "text": "# Explanation\n\nThe prompt:\n\n> Create me a sequence diagram, with no more than 10-15 calls in it showing how an edit translates into a delta that is recorded in the webapp. Put in some duration constraints, and a execution bar or 2 and use color."
    },
    {
      "id": "you~e1794205896994",
      "category": "Sequence",
      "kind": "participant",
      "name": "you:Person",
      "classifier": "actor"
    },
    {
      "id": "canvas~e1794205896995",
      "category": "Sequence",
      "kind": "participant",
      "name": ":Canvas",
      "stereotype": "autosave.js",
      "classifier": "boundary",
      "executions": [
        {
          "id": "deb~e1794205897003",
          "category": "Sequence",
          "kind": "duration",
          "label": "{400 ms}"
        }
      ]
    },
    {
      "id": "history~e1794205896996",
      "category": "Sequence",
      "kind": "participant",
      "name": ":History",
      "stereotype": "view.js",
      "classifier": "control",
      "executions": [
        {
          "id": "hbar~e1794205897004",
          "category": "Sequence",
          "kind": "execution"
        }
      ]
    },
    {
      "id": "dsync~e1794205896997",
      "category": "Sequence",
      "kind": "participant",
      "name": ":DeltaSync",
      "stereotype": "deltasync.js",
      "classifier": "control"
    },
    {
      "id": "ws~e1794205896998",
      "category": "Sequence",
      "kind": "participant",
      "name": ":WS API",
      "stereotype": "ws_api",
      "classifier": "boundary",
      "executions": [
        {
          "id": "wbar~e1794205897005",
          "category": "Sequence",
          "kind": "execution"
        }
      ]
    },
    {
      "id": "canon~e1794205896999",
      "category": "Sequence",
      "kind": "participant",
      "name": ":Canonical",
      "stereotype": "Redis",
      "classifier": "entity"
    },
    {
      "id": "reg~e1794205897000",
      "category": "Sequence",
      "kind": "participant",
      "name": ":Register",
      "stereotype": "modifications",
      "classifier": "entity"
    },
    {
      "id": "store~e1794205897001",
      "category": "Sequence",
      "kind": "participant",
      "name": ":Store",
      "stereotype": "Postgres",
      "classifier": "database",
      "executions": [
        {
          "id": "savedur~e1794206457236",
          "category": "Sequence",
          "kind": "duration",
          "label": "{≤ 5 s}"
        }
      ]
    },
    {
      "id": "mate~e1794205897002",
      "category": "Sequence",
      "kind": "participant",
      "name": "teammate:Canvas",
      "stereotype": "browser",
      "classifier": "boundary"
    },
    {
      "id": "sd~e1794205896992",
      "category": "Sequence",
      "kind": "fragment",
      "op": "sd",
      "label": "Edit → delta → recorded"
    },
    {
      "id": "par~e1794205896993",
      "category": "Sequence",
      "kind": "fragment",
      "op": "par",
      "operands": [
        {}
      ]
    }
  ],
  "links": [
    {
      "id": "link-ai-1~e1794205896995",
      "category": "Sequence",
      "kind": "sync",
      "source": "you~e1794205896994",
      "target": "canvas~e1794205896995",
      "name": "drag & drop a shape",
      "order": 1
    },
    {
      "id": "link-ai-2~e1794205896995",
      "category": "Sequence",
      "kind": "sync",
      "source": "canvas~e1794205896995",
      "target": "canvas~e1794205896995",
      "name": "markDirty(cell) · armAutosave()",
      "description": "Every graph event marks its cell dirty and re-arms a 400 ms debounce, so a burst of events becomes one capture.",
      "order": 2
    },
    {
      "id": "link-ai-3~e1794205896995",
      "category": "Sequence",
      "kind": "sync",
      "source": "canvas~e1794205896995",
      "target": "hbar~e1794205897004",
      "name": "recordStep()",
      "description": "When the debounce fires (or Cmd-Z flushes it) the canvas asks for one undo step.",
      "order": 3
    },
    {
      "id": "link-ai-4~e1794205896995",
      "category": "Sequence",
      "kind": "sync",
      "source": "hbar~e1794205897004",
      "target": "hbar~e1794205897004",
      "name": "diff()",
      "description": "A FULL diff of the anchor against the live model: everything that changed, cascades included, lands in ONE step. A teammate's relayed changes were absorbed into baseModel, so only mine remain.",
      "order": 4
    },
    {
      "id": "link-ai-5~e1794205896995",
      "category": "Sequence",
      "kind": "sync",
      "source": "hbar~e1794205897004",
      "target": "dsync~e1794205896997",
      "name": "postModel(step.keys)",
      "subtitle": "one undo step = one delta",
      "description": "The step's own keys are exactly what is sent as the sync delta.",
      "order": 5
    },
    {
      "id": "link-ai-6~e1794205896995",
      "category": "Sequence",
      "kind": "sync",
      "source": "dsync~e1794205896997",
      "target": "dsync~e1794205896997",
      "name": "computeDelta()",
      "description": "computeDelta(keys, getModel()) → {upserts, removes}. Each upsert names the fields it changed (field-level sync) and carries the whole item for older servers.",
      "order": 6
    },
    {
      "id": "link-ai-7~e1794205896995",
      "category": "Sequence",
      "kind": "async",
      "source": "dsync~e1794205896997",
      "target": "wbar~e1794205897005",
      "name": "apply_delta(delta)",
      "subtitle": "WebSocket",
      "description": "The delta crosses to the server. A failed send retries once, recomputed from the live model; persistent failure converges through reconcile.",
      "order": 7
    },
    {
      "id": "link-ai-8~e1794205896995",
      "category": "Sequence",
      "kind": "sync",
      "source": "wbar~e1794205897005",
      "target": "canon~e1794205896999",
      "name": "merge_delta()",
      "subtitle": "under the diagram's lock",
      "description": "Only the named fields of each stored item change; a field the item lacks is cleared — a bucket's update is total.",
      "order": 8
    },
    {
      "id": "link-ai-9~e1794205896995",
      "category": "Sequence",
      "kind": "sync",
      "source": "canon~e1794205896999",
      "target": "canon~e1794205896999",
      "name": "seq += 1",
      "description": "seq orders every relay: a client drops anything at or below its lastSeq and reloads on a gap.",
      "order": 9
    },
    {
      "id": "link-ai-10~e1794205896995",
      "category": "Sequence",
      "kind": "reply",
      "source": "canon~e1794205896999",
      "target": "wbar~e1794205897005",
      "name": "merged items · seq",
      "order": 10
    },
    {
      "id": "link-ai-11~e1794205896995",
      "category": "Sequence",
      "kind": "async",
      "source": "wbar~e1794205897005",
      "target": "mate~e1794205897002",
      "name": "relay(merged, seq)",
      "subtitle": "targeted · never back to the sender",
      "description": "Targeted, not broadcast: only the sockets with this diagram open, minus the sender — and it relays what it STORED, not what was sent.",
      "order": 11
    },
    {
      "id": "link-ai-12~e1794205896995",
      "category": "Sequence",
      "kind": "sync",
      "source": "mate~e1794205897002",
      "target": "mate~e1794205897002",
      "name": "applyDeltaMerged()",
      "description": "Absorbed into the teammate's baseModel first, so it never shows up in their own next undo step; their dragged or unsent cells are shielded.",
      "order": 12
    },
    {
      "id": "link-ai-13~e1794205896995",
      "category": "Sequence",
      "kind": "async",
      "source": "wbar~e1794205897005",
      "target": "reg~e1794205897000",
      "name": "record(source, touched)",
      "subtitle": "who · which shapes · why",
      "description": "The source is known where the change is made: person~tab for a canvas. The register keeps whose work it was and which shapes it touched; the why is the annotation on the row.",
      "order": 13
    },
    {
      "id": "link-ai-14~e1794205896995",
      "category": "Sequence",
      "kind": "reply",
      "source": "wbar~e1794205897005",
      "target": "dsync~e1794205896997",
      "name": "ack(seq)",
      "order": 14
    },
    {
      "id": "link-ai-15~e1794205896995",
      "category": "Sequence",
      "kind": "async",
      "source": "canon~e1794205896999",
      "target": "store~e1794205897001",
      "name": "save()",
      "description": "The store write is held to one per diagram per 5 s on the web and writes the shared copy as it stands — the delta is durable from here.",
      "order": 15
    }
  ]
}

Figure code: drawmode:p7bc9c303/d91b11cce

Explanation

The prompt:

Create me a sequence diagram, with no more than 10-15 calls in it showing how an edit translates into a delta that is recorded in the webapp. Put in some duration constraints, and a execution bar or 2 and use color.