{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://clear.gaiya365.com/schema/evidence-card.v1.json",
  "title": "Low-Noise evidence card v1",
  "description": "One evidence-backed claim about exercise, sleep, recovery, mind or habits. Wording is ours; facts are taken from the cited abstract and machine-checked. Educational only, not medical advice. Curated by AI and automatically checked; no expert human review.",
  "type": "object",
  "additionalProperties": false,
  "required": ["id","version","claim","mind_body_angle","domain","topic","study_type","evidence_strength","evidence_strength_basis","population","intervention_or_exposure","dose","comparator","outcome","effect","limitations","how_to_use","caution","sources","creator_views","retraction_status","date_checked","checks_passed","curation"],
  "properties": {
    "id": {"type": "string", "pattern": "^[a-z]+-[0-9]{8}$", "description": "domain prefix + PMID, e.g. sleep-38123456"},
    "version": {"type": "integer", "minimum": 1},
    "claim": {"type": "string", "minLength": 20, "maxLength": 240, "description": "One-sentence takeaway in our own words. Associational wording for observational evidence."},
    "mind_body_angle": {
      "type": "object", "additionalProperties": false, "required": ["direction","note"],
      "properties": {
        "direction": {"enum": ["body_to_mind","mind_to_body","bidirectional","behavior_habit"]},
        "note": {"type": "string", "minLength": 20, "maxLength": 260, "description": "How body, mind and way of thinking connect in this finding, without adding claims the paper does not make."}
      }
    },
    "domain": {"enum": ["exercise","recovery","mind","habit"]},
    "topic": {"type": "string", "description": "Topic slug, e.g. exercise-for-sleep, evening-exercise, training-after-poor-sleep, recovery-methods, naps-and-training, sleep-and-performance"},
    "study_type": {"enum": ["meta-analysis","systematic review","randomized controlled trial","observational","other"], "description": "Computed by program from PubMed publication types. Never AI-assigned."},
    "evidence_strength": {"enum": ["high","moderate","low","very low"], "description": "Computed by program from study type, verified study counts/sample size and certainty keywords in the abstract. Never AI-assigned."},
    "evidence_strength_basis": {"type": "string", "description": "Machine-written explanation of the rule that produced evidence_strength."},
    "population": {"type": "string", "maxLength": 240},
    "intervention_or_exposure": {"type": "string", "maxLength": 240},
    "dose": {"type": "string", "maxLength": 200, "description": "Amount, intensity, frequency, duration, timing, if reported; otherwise 'not reported'."},
    "comparator": {"type": "string", "maxLength": 200},
    "outcome": {"type": "string", "maxLength": 240},
    "effect": {"type": "string", "maxLength": 260, "description": "Direction and size; every number appears verbatim in the abstract."},
    "limitations": {"type": "string", "maxLength": 300},
    "how_to_use": {"type": "string", "maxLength": 300, "description": "Conservative, practical; no promises."},
    "caution": {"type": "string", "maxLength": 260},
    "sources": {
      "type": "array", "minItems": 1,
      "items": {
        "type": "object", "additionalProperties": false, "required": ["pmid","doi","title","journal","year","url","license"],
        "properties": {
          "pmid": {"type": ["string","null"], "pattern": "^[0-9]{6,9}$"},
          "doi": {"type": ["string","null"]},
          "title": {"type": "string"},
          "journal": {"type": "string"},
          "year": {"type": "integer"},
          "url": {"type": "string", "format": "uri"},
          "doi_url": {"type": ["string","null"]},
          "license": {"type": ["string","null"], "description": "From Europe PMC / OpenAlex when known, else null (treat as all rights reserved)."},
          "publication_types": {"type": "array", "items": {"type": "string"}},
          "cited_by_count": {"type": ["integer","null"], "description": "From OpenAlex when available."}
        }
      }
    },
    "creator_views": {
      "type": "array",
      "items": {
        "type": "object", "additionalProperties": false, "required": ["creator","outlet","headline","url","date","relation","label"],
        "properties": {
          "creator": {"type": "string"},
          "outlet": {"type": "string"},
          "headline": {"type": "string", "maxLength": 200, "description": "Verbatim post title only (short quote)."},
          "url": {"type": "string", "format": "uri"},
          "date": {"type": "string"},
          "relation": {"const": "related reading (stance not assessed)"},
          "label": {"const": "Creator view, not evidence. Not affiliated with or endorsed by this site."}
        }
      }
    },
    "retraction_status": {"enum": ["none found","retracted","expression of concern","corrected"]},
    "date_checked": {"type": "string", "format": "date"},
    "checks_passed": {"type": "array", "items": {"enum": ["numbers_verbatim","second_model_supported","program_study_type_and_strength","retraction_check","banned_words","no_copied_sentences","link_resolves","schema_valid"]}},
    "curation": {"type": "string", "const": "Curated by AI and automatically checked. No expert human review. Educational only, not medical advice."}
  }
}
