{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "UserTrajectory",
  "description": "Gold schema for real or simulated novel-reader feedback trajectories. Raw protected reader-response data is not copied unless authorized by DTA/consent.",
  "type": "object",
  "required": [
    "trajectory_id",
    "user_id",
    "source",
    "license_class",
    "uses_reranking",
    "events"
  ],
  "properties": {
    "trajectory_id": {
      "type": "string"
    },
    "user_id": {
      "type": "string"
    },
    "source": {
      "enum": [
        "public_domain",
        "webnovelbench_public",
        "novelupdates_metadata",
        "qidian_dta_authorized",
        "human_pilot",
        "synthetic_counterfactual"
      ]
    },
    "license_class": {
      "enum": [
        "public_domain",
        "metadata_only",
        "restricted_dta",
        "author_consented",
        "human_opt_in",
        "synthetic"
      ]
    },
    "uses_reranking": {
      "const": false
    },
    "reader_profile": {
      "type": "object"
    },
    "story_state": {
      "type": "object"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "event_id",
          "chapter_ref",
          "content_features",
          "explicit_feedback",
          "implicit_feedback",
          "state_before",
          "state_after",
          "gold_agent_state_update",
          "future_probes"
        ],
        "properties": {
          "event_id": {
            "type": "string"
          },
          "chapter_ref": {
            "type": "object"
          },
          "content_features": {
            "type": "object"
          },
          "explicit_feedback": {
            "type": "object"
          },
          "implicit_feedback": {
            "type": "object",
            "required": [
              "dwell_time_sec",
              "continue_next",
              "fast_swipe"
            ]
          },
          "state_before": {
            "type": "object"
          },
          "state_after": {
            "type": "object"
          },
          "gold_preference_update": {
            "type": "array"
          },
          "gold_agent_state_update": {
            "type": "array",
            "items": {
              "required": [
                "target",
                "operation",
                "content",
                "scope",
                "anti_scope",
                "ttl",
                "provenance",
                "confidence"
              ]
            }
          },
          "future_probes": {
            "type": "object",
            "required": [
              "positive",
              "anti_probe",
              "neutral"
            ]
          }
        }
      }
    }
  }
}
