-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch-request.schema.json
More file actions
100 lines (100 loc) · 3.1 KB
/
patch-request.schema.json
File metadata and controls
100 lines (100 loc) · 3.1 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
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
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://aicore.dev/schemas/agent/patch-request-1.0.schema.json",
"title": "AIC Agent Patch Request v1.0",
"type": "object",
"additionalProperties": false,
"required": ["operations"],
"properties": {
"operations": {
"type": "array",
"minItems": 1,
"items": {
"oneOf": [
{ "$ref": "#/$defs/add_function_operation" },
{ "$ref": "#/$defs/modify_match_arm_operation" },
{ "$ref": "#/$defs/add_field_operation" }
]
}
}
},
"$defs": {
"add_function_operation": {
"type": "object",
"additionalProperties": false,
"required": ["kind", "function"],
"properties": {
"kind": { "const": "add_function" },
"target_file": { "type": "string" },
"after_symbol": { "type": "string" },
"function": { "$ref": "#/$defs/function_spec" }
}
},
"modify_match_arm_operation": {
"type": "object",
"additionalProperties": false,
"required": ["kind", "target_function", "match_index", "arm_pattern", "new_body"],
"properties": {
"kind": { "const": "modify_match_arm" },
"target_file": { "type": "string" },
"target_function": { "type": "string", "minLength": 1 },
"match_index": { "type": "integer", "minimum": 0 },
"arm_pattern": { "type": "string", "minLength": 1 },
"new_body": { "type": "string", "minLength": 1 }
}
},
"add_field_operation": {
"type": "object",
"additionalProperties": false,
"required": ["kind", "target_struct", "field"],
"properties": {
"kind": { "const": "add_field" },
"target_file": { "type": "string" },
"target_struct": { "type": "string", "minLength": 1 },
"field": { "$ref": "#/$defs/field_spec" }
}
},
"function_spec": {
"type": "object",
"additionalProperties": false,
"required": ["name", "return_type", "body"],
"properties": {
"name": { "type": "string", "minLength": 1 },
"params": {
"type": "array",
"items": { "$ref": "#/$defs/param_spec" }
},
"return_type": { "type": "string", "minLength": 1 },
"body": { "type": "string", "minLength": 1 },
"effects": {
"type": "array",
"items": { "type": "string", "minLength": 1 }
},
"capabilities": {
"type": "array",
"items": { "type": "string", "minLength": 1 }
},
"requires": { "type": "string" },
"ensures": { "type": "string" }
}
},
"param_spec": {
"type": "object",
"additionalProperties": false,
"required": ["name", "ty"],
"properties": {
"name": { "type": "string", "minLength": 1 },
"ty": { "type": "string", "minLength": 1 }
}
},
"field_spec": {
"type": "object",
"additionalProperties": false,
"required": ["name", "ty"],
"properties": {
"name": { "type": "string", "minLength": 1 },
"ty": { "type": "string", "minLength": 1 }
}
}
}
}