{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/waymark-network/json-schema/waymark-network-route-record-schema.json",
  "title": "RouteRecord",
  "description": "Full route record from /r/{id}.json.",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/waymark-network-openapi.json#/components/schemas/RouteRecord",
  "type": "object",
  "required": [
    "id",
    "task",
    "domain",
    "steps",
    "created",
    "attestations",
    "url"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "task": {
      "type": "string"
    },
    "domain": {
      "type": "string"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "gotchas": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "contributor": {
      "type": "string"
    },
    "created": {
      "type": "string",
      "format": "date-time"
    },
    "attestations": {
      "type": "object",
      "properties": {
        "success": {
          "type": "integer"
        },
        "failure": {
          "type": "integer"
        },
        "keyed_success": {
          "type": "integer",
          "description": "Attestations attributed to a validated contributor key. A subset of success, not a separate tally."
        },
        "keyed_failure": {
          "type": "integer",
          "description": "Keyed subset of failure."
        },
        "last_attested": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "success_rate": {
      "type": [
        "number",
        "null"
      ],
      "description": "success / (success+failure), or null if never attested."
    },
    "effective_trust": {
      "type": "number",
      "description": "Time-decayed trust: 0.5 + (laplace(success,failure) - 0.5) * 0.5^(days_since_last_attestation/60). Reverts toward the 0.5 neutral prior as evidence ages; this is the number retrieval ranking weighs."
    },
    "evidence_age_days": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Days since the last attestation, or null if never attested."
    },
    "trust_half_life_days": {
      "type": "integer",
      "description": "Half-life of attestation weight in days (60 — matches /drift)."
    },
    "verification": {
      "$ref": "#/$defs/Verification"
    },
    "url": {
      "type": "string",
      "format": "uri"
    }
  },
  "$defs": {
    "Verification": {
      "type": "object",
      "description": "Provenance/fact-check axis — distinct from attestation consensus.",
      "properties": {
        "status": {
          "type": "string"
        },
        "method": {
          "type": "string"
        }
      }
    }
  }
}