{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://kineticgain.com/specs/cineprompt.spec.json",
  "title": "Cine-Ops Cinematic Prompt Protocol (cineprompt)",
  "description": "An open JSON schema for deterministic, attestable cinematic prompts for generative image and video models. Part of the Kinetic Gain Protocol Suite — governance and evidence declaration layer for AI prompt engineering.",
  "version": "1.0.0",
  "publisher": {
    "name": "Kinetic Gain LLC",
    "url": "https://kineticgain.com"
  },
  "type": "object",
  "required": ["specVersion", "input", "output", "metadata"],
  "properties": {
    "specVersion": {
      "type": "string",
      "const": "1.0.0",
      "description": "Pinned spec version for this artifact."
    },
    "input": {
      "type": "object",
      "required": [
        "themeId",
        "cameraId",
        "lensId",
        "shotTypeId",
        "lightingId",
        "colorGradingId",
        "compositionId",
        "faceCoreId",
        "aspectRatio"
      ],
      "properties": {
        "themeId":         { "type": "string", "description": "Scene / location identifier from themes.json." },
        "cameraId":        { "type": "string", "description": "Camera body identifier from cameras.json." },
        "lensId":          { "type": "string", "description": "Lens identifier from lenses.json." },
        "shotTypeId":      { "type": "string", "description": "Shot type / framing identifier from shot-types.json." },
        "lightingId":      { "type": "string", "description": "Lighting preset identifier from lighting.json." },
        "colorGradingId":  { "type": "string", "description": "Color grading look identifier from color-grading.json." },
        "compositionId":   { "type": "string", "description": "Composition rule identifier from composition.json." },
        "faceCoreId":      { "type": "string", "description": "Subject Fidelity Pattern (Face Core) identifier from face-cores.json." },
        "aspectRatio":     { "type": "string", "enum": ["16:9", "9:16", "1:1", "2.35:1"] }
      },
      "additionalProperties": false
    },
    "output": {
      "type": "object",
      "required": ["positive", "negative"],
      "properties": {
        "positive": { "type": "string", "description": "Built prompt string." },
        "negative": { "type": "string", "description": "Likeness-Safe Negative block (Subject Fidelity Pattern)." }
      },
      "additionalProperties": false
    },
    "metadata": {
      "type": "object",
      "required": ["builtAt", "builderVersion"],
      "properties": {
        "builtAt":        { "type": "string", "format": "date-time" },
        "builderVersion": { "type": "string", "description": "promptBuilder.ts version that produced this artifact." },
        "tokenEstimate":  { "type": "integer", "minimum": 0 },
        "charCount":      { "type": "integer", "minimum": 0 }
      }
    },
    "signature": {
      "type": "object",
      "description": "Optional ed25519 signature over the canonical JSON of input + output + metadata.",
      "required": ["algorithm", "publicKeyId", "value"],
      "properties": {
        "algorithm":   { "type": "string", "const": "ed25519" },
        "publicKeyId": { "type": "string", "description": "Identifier of the signing key (matches /.well-known/cine-ops-verify.json)." },
        "value":       { "type": "string", "description": "Base64-encoded signature bytes." },
        "signedAt":    { "type": "string", "format": "date-time" }
      }
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "specVersion": "1.0.0",
      "input": {
        "themeId": "urban_night",
        "cameraId": "alexa_35",
        "lensId": "cooke_s4",
        "shotTypeId": "portrait",
        "lightingId": "rembrandt",
        "colorGradingId": "cinematic",
        "compositionId": "rule_thirds",
        "faceCoreId": "generic_male",
        "aspectRatio": "16:9"
      },
      "output": {
        "positive": "Hyper-realistic close-up portrait, 85mm portrait lens, shallow depth of field, sharp focus on eyes, natural skin texture, visible pores of a male model with balanced facial symmetry, neutral expression, naturalistic skin texture. standing alone on a rain-slicked concrete rooftop in the heart of a dense city at night. Steel, glass, and neon — skyscraper lights cutting through deep indigo sky. Moody directional lighting with hard practical light creating sharp highlights and deep shadows. Shot on Arri Alexa 35, 4.6K resolution, cinematic depth of field, creamy bokeh, natural skin tones, smooth highlight roll-off, soft contrast with Cooke S4/i prime lenses, warm romantic rendering, gentle on skin. classic Rembrandt lighting at 45 degrees, triangle of light on shadowed cheek. rule of thirds composition, subject positioned at intersection points. cinematic color grading, teal and orange color palette, film look. 16:9 aspect ratio.",
        "negative": "plastic skin, beauty retouching, wide-angle lens distortion, cinematic haze, glam or influencer lighting, cartoon realism, AI artifacts, bad anatomy, deformed hands, asymmetric eyes, extra fingers, melted features, over-smoothed skin, uncanny valley rendering"
      },
      "metadata": {
        "builtAt": "2026-06-19T12:00:00Z",
        "builderVersion": "1.0.0",
        "tokenEstimate": 250,
        "charCount": 1000
      }
    }
  ]
}
