{
  "$defs": {
    "ArtifactMeta": {
      "additionalProperties": false,
      "properties": {
        "artifact_id": {
          "anyOf": [
            {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]*$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Artifact Id"
        },
        "role": {
          "$ref": "#/$defs/ArtifactRole",
          "default": "si_internal"
        },
        "status": {
          "$ref": "#/$defs/ArtifactStatus",
          "default": "draft"
        },
        "contract_version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Contract Version"
        },
        "compatibility": {
          "$ref": "#/$defs/CompatibilityClass",
          "default": "none"
        },
        "published_at": {
          "anyOf": [
            {
              "format": "date",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Published At"
        },
        "supersedes": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Supersedes"
        },
        "intended_consumers": {
          "items": {
            "type": "string"
          },
          "title": "Intended Consumers",
          "type": "array"
        },
        "lifecycle_state": {
          "$ref": "#/$defs/LifecycleState",
          "default": "active"
        },
        "deprecated_at": {
          "anyOf": [
            {
              "format": "date",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Deprecated At"
        },
        "sunset_at": {
          "anyOf": [
            {
              "format": "date",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Sunset At"
        },
        "replaced_by": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Replaced By"
        }
      },
      "title": "ArtifactMeta",
      "type": "object"
    },
    "ArtifactRole": {
      "enum": [
        "si_internal",
        "integration_contract",
        "exchange_projection"
      ],
      "title": "ArtifactRole",
      "type": "string"
    },
    "ArtifactStatus": {
      "enum": [
        "draft",
        "released",
        "deprecated",
        "withdrawn"
      ],
      "title": "ArtifactStatus",
      "type": "string"
    },
    "CompatibilityClass": {
      "enum": [
        "none",
        "backward",
        "forward",
        "full"
      ],
      "title": "CompatibilityClass",
      "type": "string"
    },
    "Component": {
      "additionalProperties": false,
      "description": "Replaces legacy System (\u00a74). Execution host and interface container.",
      "properties": {
        "id": {
          "description": "Stable identifier, e.g. RCS.",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]*$",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "description": "Display name.",
          "title": "Name",
          "type": "string"
        },
        "modes": {
          "description": "Vendor-owned canonical mode definitions for this component. Functions may only reference a subset of these mode IDs.",
          "items": {
            "$ref": "#/$defs/Mode"
          },
          "title": "Modes",
          "type": "array"
        },
        "modules": {
          "description": "Physical/logical subdivisions.",
          "items": {
            "$ref": "#/$defs/Module"
          },
          "title": "Modules",
          "type": "array"
        },
        "ports": {
          "description": "Dedicated interface endpoints for connection edges and ontology predicates.",
          "items": {
            "$ref": "#/$defs/Port"
          },
          "title": "Ports",
          "type": "array"
        },
        "vendor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Vendor metadata.",
          "title": "Vendor"
        },
        "notes": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Notes"
        }
      },
      "required": [
        "id",
        "name"
      ],
      "title": "Component",
      "type": "object"
    },
    "Direction": {
      "enum": [
        "in",
        "out"
      ],
      "title": "Direction",
      "type": "string"
    },
    "DiscreteEntry": {
      "additionalProperties": false,
      "properties": {
        "raw": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "integer"
            },
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ],
          "title": "Raw"
        },
        "meaning": {
          "title": "Meaning",
          "type": "string"
        }
      },
      "required": [
        "raw",
        "meaning"
      ],
      "title": "DiscreteEntry",
      "type": "object"
    },
    "DiscreteMapping": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "discrete",
          "default": "discrete",
          "title": "Kind",
          "type": "string"
        },
        "entries": {
          "items": {
            "$ref": "#/$defs/DiscreteEntry"
          },
          "minItems": 1,
          "title": "Entries",
          "type": "array"
        }
      },
      "required": [
        "entries"
      ],
      "title": "DiscreteMapping",
      "type": "object"
    },
    "Function": {
      "additionalProperties": false,
      "description": "Unified hierarchical function entity (\u00a77). No system/component-level split.",
      "properties": {
        "id": {
          "description": "Stable function identifier.",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]*$",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "description": "e.g. VFD Start/Stop (Remote).",
          "title": "Name",
          "type": "string"
        },
        "component_id": {
          "description": "ID of the component this function is allocated to, if already allocated.",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]*$",
          "title": "Component Id",
          "type": "string"
        },
        "modes": {
          "description": "References to Component.modes[*].id where this function is allowed to execute.",
          "items": {
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]*$",
            "type": "string"
          },
          "minItems": 1,
          "title": "Modes",
          "type": "array"
        },
        "input_signals": {
          "description": "Signals consumed by the function.",
          "items": {
            "$ref": "#/$defs/Signal"
          },
          "title": "Input Signals",
          "type": "array"
        },
        "output_signals": {
          "description": "Signals produced by the function.",
          "items": {
            "$ref": "#/$defs/Signal"
          },
          "title": "Output Signals",
          "type": "array"
        },
        "parameters": {
          "description": "Typed function parameters with name and type.",
          "items": {
            "$ref": "#/$defs/Parameter"
          },
          "title": "Parameters",
          "type": "array"
        },
        "function_description": {
          "description": "Required free text describing function behavior for SI mapping. Include applicable standards and references (e.g., DNV-RP-0684 Annex A, SysML v2, or domain-specific standards) with relevant version, section, and constraint details.",
          "minLength": 1,
          "title": "Function Description",
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "component_id",
        "modes",
        "function_description"
      ],
      "title": "Function",
      "type": "object"
    },
    "LifecycleState": {
      "enum": [
        "active",
        "deprecated",
        "withdrawn"
      ],
      "title": "LifecycleState",
      "type": "string"
    },
    "LinearMapping": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "linear",
          "default": "linear",
          "title": "Kind",
          "type": "string"
        },
        "raw": {
          "$ref": "#/$defs/RangeEndpoint"
        },
        "physical": {
          "$ref": "#/$defs/RangeEndpoint"
        },
        "ramp": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ramp"
        }
      },
      "required": [
        "raw",
        "physical"
      ],
      "title": "LinearMapping",
      "type": "object"
    },
    "Mode": {
      "additionalProperties": false,
      "description": "Vendor-defined component mode definition, referenced by functions.",
      "properties": {
        "id": {
          "description": "Stable mode key such as remote or power.",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]*$",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Display label.",
          "title": "Name"
        },
        "description": {
          "description": "Required free-text semantics for the mode.",
          "minLength": 1,
          "title": "Description",
          "type": "string"
        }
      },
      "required": [
        "id",
        "description"
      ],
      "title": "Mode",
      "type": "object"
    },
    "Module": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "description": "Unique within the parent component.",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]*$",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "e.g. Main, Backup, ACU, HPS.",
          "title": "Name"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Free text description.",
          "title": "Description"
        }
      },
      "required": [
        "id"
      ],
      "title": "Module",
      "type": "object"
    },
    "Parameter": {
      "additionalProperties": false,
      "description": "Typed parameter entry on a function.",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "type": {
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "name",
        "type"
      ],
      "title": "Parameter",
      "type": "object"
    },
    "Party": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "description": "Stable cross-reference id.",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]*$",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "description": "Display name.",
          "title": "Name",
          "type": "string"
        },
        "kind": {
          "$ref": "#/$defs/PartyKind",
          "default": "vendor",
          "description": "Defaults to vendor; also supports integrator, shipowner, shipyard, analytics_provider, class_society, operator."
        },
        "role": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Project-specific role text.",
          "title": "Role"
        },
        "contact": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Contact channel.",
          "title": "Contact"
        }
      },
      "required": [
        "id",
        "name"
      ],
      "title": "Party",
      "type": "object"
    },
    "PartyKind": {
      "enum": [
        "vendor",
        "integrator",
        "shipyard",
        "shipowner",
        "class_society",
        "analytics_provider",
        "operator"
      ],
      "title": "PartyKind",
      "type": "string"
    },
    "Port": {
      "additionalProperties": false,
      "description": "First-class interface endpoint on a Component (\u00a76).",
      "properties": {
        "id": {
          "description": "Vendor specific identification of the port, e.g. 'DI01'. Unique within parent component.",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]*$",
          "title": "Id",
          "type": "string"
        },
        "direction": {
          "$ref": "#/$defs/PortDirection",
          "description": "in, out, or undefined."
        },
        "module_id": {
          "anyOf": [
            {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]*$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional owning module. If set, it must exist in Component.modules[*].id.",
          "title": "Module Id"
        },
        "terminals": {
          "description": "Physical terminal mapping.",
          "items": {
            "type": "string"
          },
          "title": "Terminals",
          "type": "array"
        },
        "port_type": {
          "anyOf": [
            {
              "$ref": "#/$defs/PortType"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Required when direction=out; optional for in and undefined."
        },
        "protocol": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Required when direction=out; optional for in and undefined.",
          "title": "Protocol"
        },
        "attributes": {
          "additionalProperties": true,
          "description": "Extensible key-value metadata (e.g. actUpon).",
          "title": "Attributes",
          "type": "object"
        }
      },
      "required": [
        "id",
        "direction"
      ],
      "title": "Port",
      "type": "object"
    },
    "PortDirection": {
      "enum": [
        "in",
        "out",
        "undefined"
      ],
      "title": "PortDirection",
      "type": "string"
    },
    "PortType": {
      "enum": [
        "signal",
        "can_tc",
        "analog",
        "resistor",
        "4-20mA",
        "0-10V",
        "serial",
        "network"
      ],
      "title": "PortType",
      "type": "string"
    },
    "ProjectMeta": {
      "additionalProperties": false,
      "properties": {
        "project_id": {
          "description": "Stable project key, e.g. eps_demo.",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]*$",
          "title": "Project Id",
          "type": "string"
        },
        "project_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Human-readable project title.",
          "title": "Project Name"
        },
        "schema_version": {
          "description": "PEP 440 version string identifying the schema version this document was authored against. Must not exceed the current package version.",
          "title": "Schema Version",
          "type": "string"
        },
        "client": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Shipyard or customer name.",
          "title": "Client"
        },
        "vessel_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Vessel classification string.",
          "title": "Vessel Type"
        },
        "revision": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Project revision label.",
          "title": "Revision"
        },
        "date": {
          "anyOf": [
            {
              "format": "date",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "ISO-8601 date.",
          "title": "Date"
        }
      },
      "required": [
        "project_id",
        "schema_version"
      ],
      "title": "ProjectMeta",
      "type": "object"
    },
    "RangeEndpoint": {
      "additionalProperties": false,
      "properties": {
        "low": {
          "title": "Low",
          "type": "number"
        },
        "high": {
          "title": "High",
          "type": "number"
        },
        "unit": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Unit"
        }
      },
      "required": [
        "low",
        "high"
      ],
      "title": "RangeEndpoint",
      "type": "object"
    },
    "Signal": {
      "additionalProperties": false,
      "description": "Project-level signal definition (\u00a79).",
      "properties": {
        "id": {
          "description": "Stable signal identifier.",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]*$",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "description": "Vendor-neutral logical name.",
          "title": "Name",
          "type": "string"
        },
        "signal_type": {
          "$ref": "#/$defs/SignalType",
          "description": "digital, analog, can, i2c, 1-wire, uart."
        },
        "category": {
          "$ref": "#/$defs/SignalCategory",
          "description": "command, permission_interlock, feedback, safety, mode, monitoring."
        },
        "subtype": {
          "description": "E.g. nc, no, pulse.",
          "items": {
            "type": "string"
          },
          "title": "Subtype",
          "type": "array"
        },
        "processing": {
          "anyOf": [
            {
              "$ref": "#/$defs/SignalProcessing"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "filtered, delay, moving_average."
        },
        "attributes": {
          "additionalProperties": true,
          "description": "scaling, sampling, fail-safe, redundancy, sync/async, compatibility.",
          "title": "Attributes",
          "type": "object"
        },
        "value_mapping": {
          "anyOf": [
            {
              "discriminator": {
                "mapping": {
                  "discrete": "#/$defs/DiscreteMapping",
                  "linear": "#/$defs/LinearMapping"
                },
                "propertyName": "kind"
              },
              "oneOf": [
                {
                  "$ref": "#/$defs/DiscreteMapping"
                },
                {
                  "$ref": "#/$defs/LinearMapping"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional raw/physical mapping.",
          "title": "Value Mapping"
        },
        "vendor_io_mappings": {
          "description": "Per-vendor IO tag bindings (party_id, item, direction, terminals).",
          "items": {
            "$ref": "#/$defs/VendorIOMapping"
          },
          "title": "Vendor Io Mappings",
          "type": "array"
        },
        "assumed": {
          "default": false,
          "description": "Mark inferred values (true) vs. values extracted from vendor documentation.",
          "title": "Assumed",
          "type": "boolean"
        },
        "source_doc_ref": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Provenance pointer to the source document or datasheet.",
          "title": "Source Doc Ref"
        },
        "notes": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Free-text notes.",
          "title": "Notes"
        }
      },
      "required": [
        "id",
        "name",
        "signal_type",
        "category"
      ],
      "title": "Signal",
      "type": "object"
    },
    "SignalCategory": {
      "enum": [
        "command",
        "permission_interlock",
        "feedback",
        "safety",
        "mode",
        "monitoring"
      ],
      "title": "SignalCategory",
      "type": "string"
    },
    "SignalProcessing": {
      "additionalProperties": false,
      "properties": {
        "filtered": {
          "default": false,
          "title": "Filtered",
          "type": "boolean"
        },
        "delay_ms": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Delay Ms"
        },
        "moving_average_window": {
          "anyOf": [
            {
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Moving Average Window"
        }
      },
      "title": "SignalProcessing",
      "type": "object"
    },
    "SignalType": {
      "enum": [
        "digital",
        "analog",
        "can",
        "i2c",
        "1-wire",
        "uart"
      ],
      "title": "SignalType",
      "type": "string"
    },
    "VendorIOMapping": {
      "additionalProperties": false,
      "properties": {
        "party_id": {
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_.\\-]*$",
          "title": "Party Id",
          "type": "string"
        },
        "item": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Item"
        },
        "direction": {
          "anyOf": [
            {
              "$ref": "#/$defs/Direction"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "signal_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Signal Type"
        },
        "terminals": {
          "items": {
            "type": "string"
          },
          "title": "Terminals",
          "type": "array"
        },
        "details": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Details"
        },
        "logic": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Logic"
        },
        "revision": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Revision"
        }
      },
      "required": [
        "party_id"
      ],
      "title": "VendorIOMapping",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "description": "Vendor-subset si-schema document.\n\nContains only the entities a component vendor is expected to populate\nand return to the system integrator. Excludes SI-only concerns such as\nconnections, contract-layer entities, and legacy system topology.",
  "properties": {
    "artefact": {
      "anyOf": [
        {
          "$ref": "#/$defs/ArtifactMeta"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "project": {
      "$ref": "#/$defs/ProjectMeta"
    },
    "parties": {
      "items": {
        "$ref": "#/$defs/Party"
      },
      "title": "Parties",
      "type": "array"
    },
    "components": {
      "items": {
        "$ref": "#/$defs/Component"
      },
      "title": "Components",
      "type": "array"
    },
    "functions": {
      "items": {
        "$ref": "#/$defs/Function"
      },
      "title": "Functions",
      "type": "array"
    },
    "signals": {
      "items": {
        "$ref": "#/$defs/Signal"
      },
      "title": "Signals",
      "type": "array"
    },
    "glossary": {
      "additionalProperties": {
        "type": "string"
      },
      "title": "Glossary",
      "type": "object"
    }
  },
  "required": [
    "project"
  ],
  "title": "VendorSISchema",
  "type": "object",
  "$id": "https://dnv-opensource.github.io/si-schema/vendor.si_schema.schema.json",
  "version": "0.1.0"
}
