{
  "$schema": "https://openworkflowgraph.org/schemas/core/v0.92.json",
  "owg_version": "0.92",
  "id": "eidr-edit-registration",
  "project_id": "eidr-edit-registration",
  "profiles": ["core"],
  "description": "EIDR binding — registering an Edit-level ID for a new localized version of a title. The finished French edit derives from the English master, a service registers it with the EIDR registry against the master's Title-level ID, and the new Edit ID is written back onto the asset as an identifier. All IDs in this document are format-correct placeholders, not registry records.",
  "objective": "Give a localized edit its own EIDR Edit ID, tied to the Title ID of the work it belongs to, and keep both IDs on the asset for every system that touches it afterwards.",
  "organizations": [
    { "id": "org_studio", "name": "Example Studio", "role": "studio" },
    { "id": "org_eidr", "name": "EIDR Registry", "role": "service-provider" }
  ],
  "participants": [
    { "id": "svc_localize", "kind": "service", "name": "Localization Service", "organization_id": "org_studio" },
    { "id": "svc_eidr_client", "kind": "service", "name": "EIDR Registration Client", "organization_id": "org_studio" },
    { "id": "metadata_lead", "kind": "human", "name": "Metadata Lead", "role": "supervisor", "organization_id": "org_studio" }
  ],
  "infrastructure": [
    { "id": "cloud_platform", "type": "saas_platform", "owner": "org_studio" },
    { "id": "eidr_registry", "type": "saas_platform", "owner": "org_eidr", "product": "EIDR registry (sandbox)" }
  ],
  "assets": [
    {
      "id": "master_en",
      "role": "source",
      "type": "video.master",
      "content_type": "video/mp4",
      "state": "accepted",
      "identifiers": [
        { "scope": "eidr.title", "id": "10.5240/0000-0000-0000-0000-0000-A" },
        { "scope": "eidr.edit",  "id": "10.5240/0000-0000-0000-0000-1111-B" }
      ],
      "storage": { "provider": "s3", "locator": "s3://studio-masters/example-title/en/master.mp4", "zone": "us-west-2" }
    },
    {
      "id": "edit_fr",
      "role": "delivery",
      "type": "video.master",
      "content_type": "video/mp4",
      "version_relation": "alternative",
      "predecessor": "master_en",
      "produced_by": "localize_fr",
      "state": "in_review",
      "identifiers": [
        { "scope": "eidr.title", "id": "10.5240/0000-0000-0000-0000-0000-A" },
        { "scope": "eidr.edit",  "id": "10.5240/0000-0000-0000-0000-2222-C" }
      ],
      "storage": { "provider": "s3", "locator": "s3://studio-masters/example-title/fr/master.mp4", "zone": "us-west-2" }
    },
    {
      "id": "eidr_registration_record",
      "role": "intermediate",
      "type": "document.record",
      "content_type": "application/xml",
      "produced_by": "register_edit",
      "storage": { "provider": "s3", "locator": "s3://studio-masters/example-title/fr/eidr-record.xml", "zone": "us-west-2" }
    }
  ],
  "tasks": [
    {
      "id": "localize_fr",
      "label": "Produce French edit (dub and subtitles)",
      "type": "task",
      "executor": { "type": "service", "ref": "localize.dub", "environment": "saas" },
      "performed_by": "svc_localize",
      "ran_on": "cloud_platform",
      "used": ["master_en"],
      "produced": ["edit_fr"],
      "failure_mode": "HALT"
    },
    {
      "id": "review_metadata",
      "label": "Approve edit descriptors before registration",
      "type": "review",
      "executor": { "type": "human", "ref": "review.approve", "environment": "desktop" },
      "performed_by": "metadata_lead",
      "used": ["edit_fr"],
      "depends_on": ["localize_fr"],
      "failure_mode": "HALT"
    },
    {
      "id": "register_edit",
      "label": "Register Edit ID against the Title ID",
      "type": "task",
      "executor": { "type": "saas_api", "ref": "eidr.register_edit", "environment": "saas" },
      "performed_by": "svc_eidr_client",
      "ran_on": "eidr_registry",
      "used": ["master_en", "edit_fr"],
      "produced": ["eidr_registration_record"],
      "depends_on": ["review_metadata"],
      "failure_mode": "HALT"
    }
  ],
  "relationships": [
    {
      "id": "rel_edit_of_title",
      "relation": "version_of",
      "from": { "kind": "asset", "id": "edit_fr" },
      "to":   { "kind": "asset", "id": "master_en" },
      "assurance": "asserted",
      "proposed_by": "svc_eidr_client",
      "accepted_by": "metadata_lead"
    }
  ]
}
