{
  "$schema": "https://digitaltwin-os.com/data/assurances.schema.json",
  "version": 1,
  "title": "How the twin works",
  "diagrams": [
    {
      "id": "why-safe",
      "kind": "process",
      "title": "Why it is safe",
      "summary": "Read first. Check each change. Keep a record.",
      "nodes": [
        {
          "id": "systems",
          "type": "system",
          "label": "Your systems",
          "hint": "Read only",
          "detail": "The twin reads from your existing systems before any change is proposed."
        },
        {
          "id": "workflow",
          "type": "workflow",
          "label": "Checked work",
          "hint": "Rules checked",
          "detail": "Each write runs through a checked workflow. Apps, workflows and integrations meet the same access rules."
        },
        {
          "id": "approval",
          "type": "human",
          "label": "Your decision",
          "hint": "Approve first",
          "detail": "Irreversible, external or regulated actions stop for a named person to approve."
        },
        {
          "id": "record",
          "type": "record",
          "label": "Saved result",
          "hint": "Who + when",
          "detail": "Each write leaves a record of who acted, when, from which source and why. History is append-only."
        }
      ],
      "edges": [
        {
          "from": "systems",
          "to": "workflow",
          "type": "feeds",
          "label": "Read data"
        },
        {
          "from": "workflow",
          "to": "approval",
          "type": "gates",
          "label": "When needed"
        },
        {
          "from": "approval",
          "to": "record",
          "type": "records",
          "label": "Then write"
        }
      ]
    },
    {
      "id": "why-fast",
      "kind": "process",
      "title": "Why it is fast",
      "summary": "One workflow replaces repeated handoffs.",
      "nodes": [
        {
          "id": "request",
          "type": "system",
          "label": "New request",
          "hint": "Start here",
          "detail": "A routine request enters one workflow rather than waiting in separate handoff queues."
        },
        {
          "id": "workflow",
          "type": "workflow",
          "label": "Repeatable work",
          "hint": "Same steps",
          "detail": "Software carries the repeatable steps in a checked workflow."
        },
        {
          "id": "decision",
          "type": "human",
          "label": "One decision",
          "hint": "You approve",
          "detail": "A person sees the decision that matters, with the relevant facts attached."
        },
        {
          "id": "result",
          "type": "record",
          "label": "Saved result",
          "hint": "No retyping",
          "detail": "The result is recorded, so it does not have to be re-entered at the next handoff. This is a process illustration, not a speed benchmark."
        }
      ],
      "edges": [
        {
          "from": "request",
          "to": "workflow",
          "type": "feeds",
          "label": "Run steps"
        },
        {
          "from": "workflow",
          "to": "decision",
          "type": "gates",
          "label": "Decide"
        },
        {
          "from": "decision",
          "to": "result",
          "type": "records",
          "label": "Record"
        }
      ]
    },
    {
      "id": "guarantees",
      "kind": "principles",
      "title": "What we guarantee",
      "summary": "Visible history. Clear ownership. Measured results.",
      "nodes": [
        {
          "id": "history",
          "type": "principle",
          "label": "Full history",
          "hint": "No silent edits",
          "detail": "Keep a complete, append-only history. Changes identify who acted, when, from which source and why."
        },
        {
          "id": "owner",
          "type": "human",
          "label": "Named owner",
          "hint": "Accountable",
          "detail": "A named person is accountable for each decision that matters."
        },
        {
          "id": "systems",
          "type": "system",
          "label": "Your systems",
          "hint": "Stay yours",
          "detail": "Your systems of record keep running alongside the twin."
        },
        {
          "id": "fee",
          "type": "principle",
          "label": "Results fee",
          "hint": "Measured gain",
          "detail": "We charge a share of improvement against an agreed baseline. If the number does not move, we do not get paid."
        }
      ],
      "edges": []
    },
    {
      "id": "data-boundaries",
      "kind": "architecture",
      "title": "Your data and access",
      "summary": "Your records, behind explicit access rules.",
      "nodes": [
        {
          "id": "systems",
          "type": "system",
          "label": "Your systems",
          "hint": "Keep running",
          "detail": "Your systems of record stay yours and continue to run."
        },
        {
          "id": "workspace",
          "type": "record",
          "label": "Your workspace",
          "hint": "Holds records",
          "detail": "The twin stores its records in your workspace. Access rules are compiled into the database."
        },
        {
          "id": "portal",
          "type": "portal",
          "label": "Your portal",
          "hint": "Files + messages",
          "detail": "Use the private portal for communication, files, work, metrics and terms. Uploads land in your workspace with a receipt."
        },
        {
          "id": "access",
          "type": "access",
          "label": "Scoped keys",
          "hint": "You can revoke",
          "detail": "The team reaches your workspace through scoped keys that you can revoke from the portal."
        }
      ],
      "edges": [
        {
          "from": "systems",
          "to": "workspace",
          "type": "mirrors",
          "label": "Mirrors records into"
        },
        {
          "from": "portal",
          "to": "workspace",
          "type": "uploads",
          "label": "Uploads with receipts to"
        },
        {
          "from": "access",
          "to": "workspace",
          "type": "authorizes",
          "label": "Limits team access to"
        }
      ]
    }
  ]
}
