-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproof-pack.schema.json
More file actions
241 lines (241 loc) · 8.4 KB
/
Copy pathproof-pack.schema.json
File metadata and controls
241 lines (241 loc) · 8.4 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://antbotics.com/proof-pack/0.1/proof-pack.schema.json",
"title": "Proof Pack",
"description": "A package-level, verifiable record that a maintenance job was completed, what surfaces were covered, and the before/after evidence that proves it.",
"type": "object",
"required": ["specVersion", "id", "issuer", "job", "site", "evidence", "integrity"],
"additionalProperties": false,
"properties": {
"specVersion": {
"type": "string",
"description": "Version of the Proof Pack specification this document conforms to.",
"pattern": "^\\d+\\.\\d+\\.\\d+$"
},
"id": {
"type": "string",
"description": "Globally unique identifier for this Proof Pack (UUID recommended).",
"minLength": 1
},
"issuer": {
"type": "object",
"description": "The organization that produced and stands behind this Proof Pack.",
"required": ["name", "id"],
"additionalProperties": false,
"properties": {
"name": { "type": "string", "minLength": 1 },
"id": { "type": "string", "minLength": 1 },
"contact": { "type": "string" }
}
},
"job": {
"type": "object",
"description": "The maintenance job this Proof Pack documents.",
"required": ["id", "serviceType", "completedAt"],
"additionalProperties": false,
"properties": {
"id": { "type": "string", "minLength": 1 },
"reference": {
"type": "string",
"description": "Human-facing job or contract reference."
},
"serviceType": {
"type": "string",
"description": "Category of work performed.",
"enum": [
"facade-cleaning",
"window-cleaning",
"solar-panel-cleaning",
"roof-cleaning",
"inspection",
"other"
]
},
"scheduledStart": { "type": "string", "format": "date-time" },
"startedAt": { "type": "string", "format": "date-time" },
"completedAt": { "type": "string", "format": "date-time" }
}
},
"site": {
"type": "object",
"description": "Where the work was performed.",
"required": ["name"],
"additionalProperties": false,
"properties": {
"name": { "type": "string", "minLength": 1 },
"address": { "type": "string" },
"geo": { "$ref": "#/$defs/geoPoint" },
"timezone": {
"type": "string",
"description": "IANA timezone name, e.g. Asia/Dubai."
}
}
},
"assets": {
"type": "array",
"description": "The robots, drones, or equipment that performed the work.",
"items": {
"type": "object",
"required": ["id", "type"],
"additionalProperties": false,
"properties": {
"id": { "type": "string", "minLength": 1 },
"type": {
"type": "string",
"enum": ["drone", "crawler", "robot", "manual", "other"]
},
"model": { "type": "string" },
"operator": {
"type": "object",
"description": "The person accountable for supervising the asset during the job.",
"required": ["id"],
"additionalProperties": false,
"properties": {
"id": { "type": "string", "minLength": 1 },
"name": { "type": "string" }
}
}
}
}
},
"surfaces": {
"type": "array",
"description": "The distinct surfaces or zones serviced during the job.",
"items": {
"type": "object",
"required": ["id", "label"],
"additionalProperties": false,
"properties": {
"id": { "type": "string", "minLength": 1 },
"label": { "type": "string", "minLength": 1 },
"material": {
"type": "string",
"enum": ["glass", "stone", "metal", "composite", "solar", "concrete", "other"]
},
"areaSqm": { "type": "number", "minimum": 0 },
"geometry": {
"description": "Optional GeoJSON geometry describing the surface footprint.",
"type": "object"
}
}
}
},
"coverage": {
"type": "object",
"description": "Quantified coverage outcome for the job.",
"additionalProperties": false,
"properties": {
"plannedAreaSqm": { "type": "number", "minimum": 0 },
"coveredAreaSqm": { "type": "number", "minimum": 0 },
"coveragePercent": { "type": "number", "minimum": 0, "maximum": 100 },
"heatmap": { "$ref": "#/$defs/mediaRef" }
}
},
"evidence": {
"type": "array",
"description": "Captured media that substantiates the job outcome. A valid Proof Pack contains at least one item.",
"minItems": 1,
"items": {
"type": "object",
"required": ["id", "kind", "capturedAt", "media"],
"additionalProperties": false,
"properties": {
"id": { "type": "string", "minLength": 1 },
"kind": {
"type": "string",
"enum": ["before", "after", "during", "defect", "thermal", "wide", "other"]
},
"surfaceId": {
"type": "string",
"description": "References surfaces[].id."
},
"pairId": {
"type": "string",
"description": "Links a before item to its matching after item via a shared value."
},
"capturedAt": { "type": "string", "format": "date-time" },
"capturedBy": {
"type": "string",
"description": "References assets[].id of the capturing device."
},
"geo": { "$ref": "#/$defs/geoPoint" },
"media": { "$ref": "#/$defs/mediaRef" }
}
}
},
"integrity": {
"type": "object",
"description": "Tamper-evidence for the Proof Pack as a whole. See the specification for the canonicalization rules used to compute manifestHash.",
"required": ["algorithm", "manifestHash"],
"additionalProperties": false,
"properties": {
"algorithm": {
"type": "string",
"enum": ["sha256", "sha384", "sha512"]
},
"manifestHash": {
"type": "string",
"description": "Hash over the canonicalized Proof Pack with the integrity.manifestHash and integrity.signature fields excluded.",
"pattern": "^[A-Fa-f0-9]+$"
},
"previousHash": {
"type": "string",
"description": "manifestHash of the prior Proof Pack issued by this issuer, forming a per-issuer hash chain.",
"pattern": "^[A-Fa-f0-9]+$"
},
"signature": {
"type": "object",
"description": "Optional detached signature over manifestHash.",
"required": ["algorithm", "value"],
"additionalProperties": false,
"properties": {
"algorithm": { "type": "string" },
"value": { "type": "string" },
"publicKey": { "type": "string" },
"certificate": { "type": "string" }
}
}
}
}
},
"$defs": {
"geoPoint": {
"type": "object",
"description": "WGS84 coordinate.",
"required": ["lat", "lon"],
"additionalProperties": false,
"properties": {
"lat": { "type": "number", "minimum": -90, "maximum": 90 },
"lon": { "type": "number", "minimum": -180, "maximum": 180 },
"altitudeMeters": { "type": "number" }
}
},
"mediaRef": {
"type": "object",
"description": "A reference to a media file stored alongside the manifest, with a content hash so it cannot be silently swapped.",
"required": ["path", "mediaType", "sha256"],
"additionalProperties": false,
"properties": {
"path": {
"type": "string",
"description": "Path relative to the Proof Pack root, or an absolute URL.",
"minLength": 1
},
"mediaType": {
"type": "string",
"description": "IANA media type, e.g. image/jpeg.",
"minLength": 1
},
"sha256": {
"type": "string",
"description": "Lowercase hex SHA-256 of the referenced file bytes.",
"pattern": "^[a-f0-9]{64}$"
},
"c2pa": {
"type": "boolean",
"description": "True if the referenced file carries an embedded C2PA manifest for per-asset provenance."
}
}
}
}
}