{
    "$schema": "../../../../schemas/diagram-spec.schema.json",
    "schemaVersion": "2.0",
    "diagramKind": "data-flow",
    "id": "data-flow-editorial-pipeline",
    "title": "Data Flow — Editorial Publishing Pipeline",
    "description": "Security-aware movement of authored diagram data through validation, restricted storage, and publication.",
    "language": "en",
    "boundaries": [
        {
            "id": "controlled-zone",
            "type": "trust-boundary",
            "title": "CONTROLLED PROCESSING",
            "trustLevel": "controlled"
        },
        {
            "id": "restricted-zone",
            "type": "trust-boundary",
            "title": "RESTRICTED DATA",
            "trustLevel": "restricted"
        }
    ],
    "nodes": [
        {
            "id": "authoring-workspace",
            "type": "source",
            "title": "Authoring Workspace",
            "description": "Originates reviewed diagram specifications and layouts."
        },
        {
            "id": "repository-events",
            "type": "source",
            "title": "Repository Events",
            "description": "Emits source-change notifications for continuous validation."
        },
        {
            "id": "policy-registry",
            "type": "external-system",
            "title": "Policy Registry",
            "description": "Provides the current schema and validation policy."
        },
        {
            "id": "validation-process",
            "type": "process",
            "title": "Validation Process",
            "description": "Checks source meaning, references, and spatial constraints.",
            "transformation": "Validate + normalize"
        },
        {
            "id": "diagram-store",
            "type": "data-store",
            "title": "Diagram Store",
            "description": "Persists normalized semantic sources and approved scenes.",
            "classification": "restricted"
        },
        {
            "id": "export-process",
            "type": "process",
            "title": "Export Process",
            "description": "Renders approved scenes into deterministic artifacts.",
            "transformation": "Render + package"
        },
        {
            "id": "publication-sink",
            "type": "sink",
            "title": "Publication Sink",
            "description": "Consumes editable and presentation-ready diagram artifacts."
        }
    ],
    "edges": [
        {
            "id": "authoring-to-validation",
            "from": "authoring-workspace",
            "to": "validation-process",
            "type": "data-flow",
            "dataName": "Diagram sources",
            "format": "JSON",
            "frequency": "On demand",
            "mode": "request-response",
            "classification": "confidential",
            "trustBoundaryIds": [
                "controlled-zone"
            ]
        },
        {
            "id": "events-to-validation",
            "from": "repository-events",
            "to": "validation-process",
            "type": "data-flow",
            "dataName": "Source change events",
            "format": "CloudEvents JSON",
            "frequency": "Continuous",
            "mode": "streaming",
            "classification": "internal",
            "trustBoundaryIds": [
                "controlled-zone"
            ]
        },
        {
            "id": "policy-to-validation",
            "from": "policy-registry",
            "to": "validation-process",
            "type": "data-flow",
            "dataName": "Validation policy",
            "format": "JSON Schema",
            "frequency": "At startup",
            "mode": "request-response",
            "classification": "internal",
            "trustBoundaryIds": [
                "controlled-zone"
            ]
        },
        {
            "id": "validation-to-store",
            "from": "validation-process",
            "to": "diagram-store",
            "type": "data-flow",
            "dataName": "Normalized source",
            "format": "Canonical JSON",
            "frequency": "On change",
            "mode": "streaming",
            "classification": "restricted",
            "trustBoundaryIds": [
                "restricted-zone"
            ]
        },
        {
            "id": "store-to-export",
            "from": "diagram-store",
            "to": "export-process",
            "type": "data-flow",
            "dataName": "Approved Scene",
            "format": "Scene Model",
            "frequency": "Nightly",
            "mode": "batch",
            "classification": "confidential",
            "trustBoundaryIds": [
                "restricted-zone"
            ]
        },
        {
            "id": "export-to-publication",
            "from": "export-process",
            "to": "publication-sink",
            "type": "data-flow",
            "dataName": "Diagram artifacts",
            "format": "draw.io/SVG/PNG",
            "frequency": "Nightly",
            "mode": "batch",
            "classification": "public",
            "trustBoundaryIds": [
                "controlled-zone"
            ]
        }
    ]
}
