{
  "$schema": "../schemas/relaymark-directive.schema.json",
  "name": "NoteRef",
  "ast_type": "relay.note_ref",
  "version": 1,
  "category": "source",
  "description": "A reference to a note or document block that grounds nearby content.",
  "attributes": {
    "document": {
      "type": "string",
      "description": "Referenced document id."
    },
    "block": {
      "type": "string",
      "description": "Referenced block id within the document."
    },
    "label": {
      "type": "string",
      "description": "Human-readable source label."
    },
    "scope": {
      "type": "enum",
      "values": ["private", "org", "unlisted", "public"],
      "default": "private"
    }
  },
  "children": {
    "mode": "mixed",
    "allowed_types": ["paragraph", "text"],
    "min": 0
  },
  "validation": [
    "document or block should resolve to a readable Relay document context",
    "scope must be allowed by the current document and user scope"
  ],
  "projections": {
    "relay_kit": "SourceRef",
    "html": "source-ref",
    "plain_text": "note source label",
    "manifest": ["sources"]
  },
  "policy": {
    "requires_review": false,
    "requires_evidence": false,
    "allows_agent_creation": true,
    "visibility_attribute": "scope"
  }
}
