{
  "schema_version": 1,
  "diagram_type": "architecture",
  "meta": {
    "title": "Interface por vínculo",
    "subtitle": "Apresentação por membro sem nova autorização",
    "output": "interface-por-vinculo.html",
    "quality_profile": "standard"
  },
  "lanes": [
    {
      "id": "humano",
      "label": "Pessoa"
    },
    {
      "id": "app",
      "label": "Aplicativo"
    },
    {
      "id": "db",
      "label": "Banco"
    }
  ],
  "mainPath": [
    "editor",
    "write",
    "membership",
    "context",
    "catalog",
    "navigation"
  ],
  "nodes": [
    {
      "id": "editor",
      "lane": "humano",
      "col": 0,
      "type": "ui",
      "label": "Equipe / convite / criar responsável"
    },
    {
      "id": "write",
      "lane": "app",
      "col": 1,
      "type": "service",
      "label": "Zod + papel admin + organização confiável"
    },
    {
      "id": "invite",
      "lane": "app",
      "col": 2,
      "type": "service",
      "label": "issueInvite → HMAC → aceite transacional"
    },
    {
      "id": "membership",
      "lane": "db",
      "col": 3,
      "type": "database",
      "label": "user_organizations.interface_settings"
    },
    {
      "id": "context",
      "lane": "app",
      "col": 4,
      "type": "service",
      "label": "loadAuthUser → resolveActiveOrg → AuthProvider"
    },
    {
      "id": "catalog",
      "lane": "app",
      "col": 5,
      "type": "service",
      "label": "Catálogo puro → projeção RBAC ∩ interface"
    },
    {
      "id": "navigation",
      "lane": "humano",
      "col": 6,
      "type": "ui",
      "label": "Sidebar / mobile / hubs / busca / home / sino"
    },
    {
      "id": "refresh",
      "lane": "app",
      "col": 7,
      "type": "service",
      "label": "Realtime + GET contexto próprio + foco/poll"
    },
    {
      "id": "audit",
      "lane": "humano",
      "col": 8,
      "type": "ui",
      "label": "team.interface_changed → Auditoria"
    }
  ],
  "edges": [
    {
      "from": "editor",
      "to": "write",
      "label": "salvar configuração"
    },
    {
      "from": "editor",
      "to": "invite",
      "label": "emitir convite"
    },
    {
      "from": "write",
      "to": "membership",
      "label": "persistir por org"
    },
    {
      "from": "invite",
      "to": "membership",
      "label": "inserir/reativar; replay preserva"
    },
    {
      "from": "membership",
      "to": "context",
      "label": "leitura autorizada"
    },
    {
      "from": "context",
      "to": "catalog",
      "label": "papel e seleção"
    },
    {
      "from": "catalog",
      "to": "navigation",
      "label": "destinos visíveis"
    },
    {
      "from": "membership",
      "to": "refresh",
      "label": "invalidação"
    },
    {
      "from": "refresh",
      "to": "context",
      "label": "refresh preserva tela"
    },
    {
      "from": "write",
      "to": "audit",
      "label": "registro da mutação"
    },
    {
      "from": "audit",
      "to": "editor",
      "label": "rever escolha"
    },
    {
      "from": "navigation",
      "to": "editor",
      "label": "equipe recuperável"
    }
  ]
}
