File size: 4,234 Bytes
9040342
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "quran.md Commentary Unit Schema v2",
  "description": "Tafsir ingested by span, never forced to one ayah. quote_ar must be a verbatim substring of the stored raw source file (verify.py gate).",
  "type": "object",
  "required": [
    "id",
    "work",
    "tradition",
    "span",
    "span_roles",
    "section_type",
    "quote_ar",
    "provenance"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^cu_[0-9a-z_]+_[0-9]+_[0-9]+(_[0-9]+)?$"
    },
    "work": {
      "type": "string",
      "description": "source id from sources/manifest.json"
    },
    "tradition": {
      "type": "string",
      "enum": [
        "imami",
        "sunni",
        "shared"
      ]
    },
    "span": {
      "type": "object",
      "required": [
        "start",
        "end"
      ],
      "properties": {
        "start": {
          "type": "string",
          "pattern": "^[0-9]+:[0-9]+$"
        },
        "end": {
          "type": "string",
          "pattern": "^[0-9]+:[0-9]+$"
        }
      }
    },
    "span_roles": {
      "type": "object",
      "description": "ayah ref -> role",
      "additionalProperties": {
        "type": "string",
        "enum": [
          "primary",
          "contextual"
        ]
      }
    },
    "section_type": {
      "type": "string",
      "enum": [
        "bayan",
        "bahth_riwai",
        "bahth_lughawi",
        "bahth_kalami",
        "bahth_fiqhi",
        "isnad_chain",
        "general_exegesis",
        "translation_note"
      ],
      "description": "Al-Mizan-style sectioning (bayan / bahth riwa'i / other bahth); mapped per-work at ingest."
    },
    "quote_ar": {
      "type": "string",
      "description": "VERBATIM substring of the stored raw source file; verify.py fails the build otherwise"
    },
    "quote_location": {
      "type": "object",
      "required": [
        "volume",
        "page",
        "char_start",
        "char_end",
        "source_id",
        "source_sha256"
      ],
      "properties": {
        "volume": {
          "type": "string"
        },
        "page": {
          "type": "string"
        },
        "char_start": {
          "type": "integer",
          "minimum": 0
        },
        "char_end": {
          "type": "integer",
          "minimum": 0
        },
        "source_id": {
          "type": "string"
        },
        "source_sha256": {
          "type": "string"
        }
      }
    },
    "summary": {
      "type": "object",
      "description": "Paraphrase — NEVER presented as a quote. Must carry generated_by.",
      "properties": {
        "text": {
          "type": "string"
        },
        "generated_by": {
          "type": "string",
          "description": "e.g. 'llm:glm-4.7@2026-11-26' or 'human:name'"
        },
        "human_reviewed": {
          "type": "boolean",
          "default": false
        }
      },
      "required": [
        "text",
        "generated_by"
      ]
    },
    "attribution_flags": {
      "type": "array",
      "description": "e.g. transmission-debate flags for Tafsir al-Qummi; never treated as plain single-author text",
      "items": {
        "type": "string"
      }
    },
    "ayah_citations": {
      "type": "array",
      "description": "Ayah refs cited by the mufassir inside this unit (parsed deterministically; feeds xref_edge exegetical)",
      "items": {
        "type": "string",
        "pattern": "^[0-9]+:[0-9]+$"
      }
    },
    "provenance": {
      "type": "object",
      "required": [
        "work",
        "author",
        "edition",
        "license",
        "retrieval_url",
        "retrieval_date",
        "source_sha256"
      ],
      "properties": {
        "work": {
          "type": "string"
        },
        "author": {
          "type": "string"
        },
        "edition": {
          "type": "string"
        },
        "license": {
          "type": "string"
        },
        "retrieval_url": {
          "type": "string"
        },
        "retrieval_date": {
          "type": "string"
        },
        "source_sha256": {
          "type": "string"
        }
      }
    }
  }
}