| 1 | { |
| 2 | "$schema" "https://json-schema.org/draft/2020-12/schema", |
| 3 | "$id" "https://cascade.dev/intercom-wire/v1/extensions/relates-to-v1.schema.json", |
| 4 | "title" "RelatesToLinkV1", |
| 5 | "description" "Связь сущностей с сообщением. Эволюция ADR 0137 (range) → точечные relatesTo.", |
| 6 | "type" "object", |
| 7 | "required" ["target_kind", "relation"], |
| 8 | "properties" { |
| 9 | "target_kind" { |
| 10 | "type" "string", |
| 11 | "enum" ["code", "message", "doc", "topic"] |
| 12 | }, |
| 13 | "relation" { |
| 14 | "type" "string", |
| 15 | "enum" ["discusses", "implements", "references", "documents", "blocks", "duplicates"] |
| 16 | }, |
| 17 | "code_ref" { "$ref": "../common/attachment-anchor.schema.json" }, |
| 18 | "message_id" { "type": "string" }, |
| 19 | "doc_path" { |
| 20 | "type" "string", |
| 21 | "description" "KB or repo-relative doc path" |
| 22 | }, |
| 23 | "topic_id" { "type": "string" }, |
| 24 | "ordinal_range" { |
| 25 | "type" "object", |
| 26 | "properties" { |
| 27 | "start_ordinal" { "type": "integer", "minimum": 1 }, |
| 28 | "end_ordinal" { "type": "integer", "minimum": 1 } |
| 29 | }, |
| 30 | "additionalProperties" false |
| 31 | }, |
| 32 | "confidence" { |
| 33 | "type" "string", |
| 34 | "enum" ["explicit", "inferred", "agent"] |
| 35 | } |
| 36 | }, |
| 37 | "additionalProperties" true, |
| 38 | "allOf" [ |
| 39 | { |
| 40 | "if" { "properties": { "target_kind": { "const": "code" } } }, |
| 41 | "then" { "required": ["code_ref"] } |
| 42 | }, |
| 43 | { |
| 44 | "if" { "properties": { "target_kind": { "const": "message" } } }, |
| 45 | "then" { "required": ["message_id"] } |
| 46 | }, |
| 47 | { |
| 48 | "if" { "properties": { "target_kind": { "const": "doc" } } }, |
| 49 | "then" { "required": ["doc_path"] } |
| 50 | } |
| 51 | ] |
| 52 | } |
| 53 | |