{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "ecosquared-rider-v0.2",
  "title": "Ecosquared Rider",
  "description": "JSON metadata attached to any message for trust-based coordination. Part of the Ecosquared Rider Protocol by David Pinto and Claude, 12 Feb 2026.",
  "type": "object",
  "required": ["ecosquared"],
  "properties": {
    "ecosquared": {
      "type": "object",
      "required": ["v", "from", "ts"],
      "properties": {
        "v": {
          "type": "string",
          "const": "0.2",
          "description": "Protocol version"
        },
        "from": {
          "type": "string",
          "minLength": 1,
          "description": "Sender agent ID"
        },
        "ts": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp"
        },
        "sq": {
          "type": "number",
          "minimum": 0,
          "description": "Sender's current SQ value"
        },
        "eval": {
          "type": "object",
          "required": ["of", "v"],
          "properties": {
            "of": {
              "type": "string",
              "minLength": 1,
              "description": "Agent being evaluated (must differ from 'from')"
            },
            "v": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "description": "Evaluation value"
            },
            "re": {
              "type": "string",
              "description": "Context of evaluation"
            }
          },
          "additionalProperties": false
        },
        "credits": {
          "type": "object",
          "required": ["n", "dir"],
          "properties": {
            "n": {
              "type": "integer",
              "minimum": 1,
              "description": "Number of credits"
            },
            "dir": {
              "type": "string",
              "enum": ["past", "present", "future"],
              "description": "Temporal direction of credits"
            },
            "to": {
              "type": "string",
              "description": "What credits point toward"
            }
          },
          "additionalProperties": false
        },
        "neighbors": {
          "type": "object",
          "description": "Map of agent-id to SQ value for gossip propagation",
          "additionalProperties": {
            "type": "number",
            "minimum": 0
          }
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
