-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhypercode-ir-v1.schema.json
More file actions
47 lines (47 loc) · 1.81 KB
/
Copy pathhypercode-ir-v1.schema.json
File metadata and controls
47 lines (47 loc) · 1.81 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
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://0al-spec.org/hypercode/ir/v1",
"title": "Hypercode Resolved-Graph IR v1",
"description": "The canonical, schema-agnostic representation emitted by `hypercode emit`. This is the cross-implementation contract: any consumer (Ontology, Hyperprompt, ...) reads this shape rather than re-implementing the .hc/.hcs parser and resolver.",
"type": "object",
"required": ["version", "nodes"],
"additionalProperties": false,
"properties": {
"version": { "const": "hypercode.ir/v1" },
"nodes": {
"type": "array",
"items": { "$ref": "#/$defs/node" }
}
},
"$defs": {
"node": {
"type": "object",
"required": ["type", "properties", "children"],
"additionalProperties": false,
"properties": {
"type": { "type": "string", "description": "The command name." },
"class": { "type": "string", "description": "Optional .class marker; omitted when absent." },
"id": { "type": "string", "description": "Optional #id marker; omitted when absent." },
"properties": {
"type": "object",
"description": "Resolved properties keyed by name.",
"additionalProperties": { "$ref": "#/$defs/resolvedValue" }
},
"children": {
"type": "array",
"items": { "$ref": "#/$defs/node" }
}
}
},
"resolvedValue": {
"type": "object",
"required": ["value", "from", "line"],
"additionalProperties": false,
"properties": {
"value": { "type": "string", "description": "The cascade-resolved value." },
"from": { "type": "string", "description": "The winning selector (provenance)." },
"line": { "type": "integer", "description": "Source line of the winning rule." }
}
}
}
}