File size: 3,362 Bytes
1e3bc19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "evidence-pack-items.schema.json",
  "title": "EvidencePackItems",
  "description": "The items an EvidencePackRef binds: content_hash is sha256 (ml-v1 canonical) of {as_of, policy_version, phase, items} exactly as listed here, so the record is verifiable against its ref without the search. Items travel beside the ref (the stream's evidence event, a cache), never inside it. Only what passed the time and rights filters is here; rank is the position after fusion and reranking.",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema_version", "pack_id", "content_hash", "as_of", "policy_version", "phase", "items"],
  "properties": {
    "schema_version": { "$ref": "common.schema.json#/$defs/schema_version" },
    "pack_id": { "$ref": "common.schema.json#/$defs/id" },
    "content_hash": { "$ref": "common.schema.json#/$defs/sha256" },
    "as_of": { "$ref": "common.schema.json#/$defs/utc" },
    "policy_version": { "$ref": "common.schema.json#/$defs/id" },
    "phase": { "$ref": "common.schema.json#/$defs/phase" },
    "items": {
      "type": "array",
      "items": { "$ref": "#/$defs/item" }
    }
  },
  "$defs": {
    "clock": {
      "description": "An instant in UTC, or a day (the motor's availability clock has day precision; a day resolves to its END, 23:59:59.999999 UTC, so a point-in-time cut earlier that day excludes it).",
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}(T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,6})?(Z|\\+00:00))?$"
    },
    "optional_clock": {
      "type": ["string", "null"],
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}(T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,6})?(Z|\\+00:00))?$"
    },
    "item": {
      "type": "object",
      "additionalProperties": false,
      "required": ["evidence_id", "source_id", "source_url", "span", "clocks", "rights_purposes", "polarity", "lang", "rank", "score", "reasons"],
      "properties": {
        "evidence_id": { "$ref": "common.schema.json#/$defs/id" },
        "source_id": { "$ref": "common.schema.json#/$defs/id" },
        "source_url": { "$ref": "common.schema.json#/$defs/https_url" },
        "span": { "type": "string", "minLength": 1, "maxLength": 600 },
        "clocks": {
          "type": "object",
          "additionalProperties": false,
          "required": ["available_at", "published_at", "captured_at"],
          "properties": {
            "available_at": { "$ref": "#/$defs/clock" },
            "published_at": { "$ref": "#/$defs/optional_clock" },
            "captured_at": { "$ref": "#/$defs/optional_clock" }
          }
        },
        "rights_purposes": {
          "type": "array",
          "uniqueItems": true,
          "items": { "enum": ["read", "process", "external_provider", "train", "retain", "publish"] }
        },
        "polarity": {
          "description": "common.schema.json#/$defs/polarity, or null when the passage carries no stance.",
          "enum": ["bull", "bear", "neutral", null]
        },
        "lang": { "type": ["string", "null"], "pattern": "^[a-z]{2}$" },
        "rank": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
        "score": { "type": "number" },
        "reasons": { "type": "array", "items": { "type": "string", "maxLength": 64 } }
      }
    }
  }
}