-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhypercode-diff-v1.schema.json
More file actions
58 lines (58 loc) · 2.24 KB
/
Copy pathhypercode-diff-v1.schema.json
File metadata and controls
58 lines (58 loc) · 2.24 KB
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
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://0al-spec.github.io/Hypercode/schema/hypercode-diff-v1.schema.json",
"title": "Hypercode diff v1",
"description": "Output of `hypercode diff --format json`: the affected-node set between two hypercode.ir/v2 documents, with reasons (old/new value and winning rule). The machine-readable invalidation feed for incremental regeneration (HC-113). The comparison covers resolved content only — document metadata (`context`, `resolver`) and provenance do not participate, so two IRs that resolve to the same graph under different contexts diff as identical (an empty `changes` array).",
"type": "object",
"required": ["version", "changes"],
"additionalProperties": false,
"properties": {
"version": {
"type": "string",
"const": "hypercode.diff/v1"
},
"changes": {
"type": "array",
"items": { "$ref": "#/$defs/change" }
}
},
"$defs": {
"change": {
"type": "object",
"required": ["kind", "node"],
"additionalProperties": false,
"properties": {
"kind": {
"type": "string",
"enum": ["added", "removed", "modified", "reordered"]
},
"node": {
"type": "string",
"description": "Selector-identity path from the root, e.g. 'Service > APIServer > Listen'."
},
"properties": {
"type": "array",
"description": "Present for kind=modified: the property-level differences.",
"items": { "$ref": "#/$defs/propertyChange" }
}
}
},
"propertyChange": {
"type": "object",
"required": ["key", "kind"],
"additionalProperties": false,
"properties": {
"key": { "type": "string" },
"kind": { "type": "string", "enum": ["added", "removed", "changed"] },
"old": { "type": "string", "description": "Scalar text of the old value." },
"new": { "type": "string", "description": "Scalar text of the new value." },
"winner": {
"type": "string",
"description": "For kind=added: the rule that introduced the value ('selector @ file:line')."
},
"oldWinner": { "type": "string" },
"newWinner": { "type": "string" }
}
}
}
}