colregs 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -11
- package/data/applicability.json +478 -503
- package/data/facts.json +22 -22
- package/data/geometry.json +8 -8
- package/data/i18n/en.json +27 -0
- package/data/i18n/fi.json +25 -0
- package/data/images.json +32 -32
- package/data/operations.json +79 -0
- package/data/rules.json +5 -0
- package/data/version.json +1 -1
- package/docs/adr/0006-json-schema-and-identifier-diff.md +2 -0
- package/docs/adr/0011-api-shape.md +7 -7
- package/docs/adr/0012-trace-and-rule2-departure-api.md +2 -2
- package/docs/adr/0014-engine-interface-owned-by-colregs.md +103 -0
- package/docs/adr/0015-rule-ids-are-paragraph-keys.md +191 -0
- package/docs/adr/0016-encounter-roles-are-pooled-across-frames.md +82 -0
- package/docs/adr/0017-closed-vocabularies-are-prefixed-identifiers.md +105 -0
- package/docs/budgets.json +8 -15
- package/docs/decisions.md +6 -0
- package/docs/identifiers.md +121 -109
- package/docs/maritime-sources.md +58 -0
- package/docs/normative-language.md +103 -0
- package/docs/part-b-invariants.md +48 -45
- package/docs/requirements.md +147 -138
- package/fixtures/applicability-fixtures.json +190 -190
- package/fixtures/situation-fixtures.json +870 -599
- package/package.json +1 -1
- package/schema/applicability-fixtures.schema.json +4 -13
- package/schema/applicability.schema.json +77 -77
- package/schema/conduct-evaluation.schema.json +135 -0
- package/schema/display-evaluation.schema.json +146 -0
- package/schema/encounter-evaluation.schema.json +109 -0
- package/schema/evaluation.schema.json +149 -0
- package/schema/fact-record.schema.json +30 -0
- package/schema/facts.schema.json +4 -4
- package/schema/i18n-catalog.schema.json +47 -0
- package/schema/operations.schema.json +124 -0
- package/schema/rule2-departure-finding.schema.json +72 -0
- package/schema/rule2-departure-model.schema.json +159 -0
- package/schema/situation-fixtures.schema.json +30 -127
- package/schema/situation.schema.json +72 -0
- package/schema/trace.schema.json +33 -0
- package/data/deprecated-identifiers.json +0 -7
- package/schema/deprecated-identifiers.schema.json +0 -29
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "colregs",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "COLREGS 72 and its national amalgamations as language-neutral JSON — rule text, light definitions, and applicability predicates — with cross-implementation fixtures",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,14 +8,7 @@
|
|
|
8
8
|
"additionalProperties": false,
|
|
9
9
|
"required": ["jurisdiction", "cases"],
|
|
10
10
|
"$defs": {
|
|
11
|
-
"
|
|
12
|
-
"oneOf": [
|
|
13
|
-
{ "type": "string", "pattern": "^[a-z][a-z0-9_]*:[a-z0-9_]+$" },
|
|
14
|
-
{ "type": "number" },
|
|
15
|
-
{ "type": "boolean" }
|
|
16
|
-
]
|
|
17
|
-
},
|
|
18
|
-
"entryId": { "type": "string", "pattern": "^[0-9]+[a-z0-9]*(-[a-z0-9]+)?$" }
|
|
11
|
+
"ruleId": { "$ref": "applicability.schema.json#/$defs/ruleId" }
|
|
19
12
|
},
|
|
20
13
|
"properties": {
|
|
21
14
|
"note": { "type": "string" },
|
|
@@ -31,16 +24,14 @@
|
|
|
31
24
|
"name": { "type": "string", "minLength": 1 },
|
|
32
25
|
"jurisdiction": { "type": "string", "pattern": "^[a-z]+(/[a-z]+)*$" },
|
|
33
26
|
"facts": {
|
|
27
|
+
"$comment": "A FactRecord (schema/fact-record.schema.json, ADR 0014); a case asserts at least one fact.",
|
|
34
28
|
"type": "object",
|
|
35
29
|
"minProperties": 1,
|
|
36
|
-
"
|
|
37
|
-
"patternProperties": {
|
|
38
|
-
"^fact:[a-z0-9_]+$": { "$ref": "#/$defs/factValue" }
|
|
39
|
-
}
|
|
30
|
+
"$ref": "fact-record.schema.json"
|
|
40
31
|
},
|
|
41
32
|
"expect": {
|
|
42
33
|
"type": "array",
|
|
43
|
-
"items": { "$ref": "#/$defs/
|
|
34
|
+
"items": { "$ref": "#/$defs/ruleId" }
|
|
44
35
|
}
|
|
45
36
|
}
|
|
46
37
|
}
|
|
@@ -7,10 +7,24 @@
|
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"required": ["entries"],
|
|
9
9
|
"$defs": {
|
|
10
|
-
"
|
|
10
|
+
"ruleCategory": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"enum": [
|
|
13
|
+
"category:definition",
|
|
14
|
+
"category:standard",
|
|
15
|
+
"category:scope",
|
|
16
|
+
"category:display",
|
|
17
|
+
"category:classification",
|
|
18
|
+
"category:precedence",
|
|
19
|
+
"category:conduct",
|
|
20
|
+
"category:care",
|
|
21
|
+
"category:meta"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"ruleId": { "type": "string", "pattern": "^rule:[0-9]+[a-z]?(_[ivx]+)*(:[a-z][a-z0-9_]*)?$" },
|
|
11
25
|
"modality": {
|
|
12
26
|
"type": "string",
|
|
13
|
-
"enum": ["shall", "may", "shall-if-practicable", "conditional", "exempt", "shall-not", "shall-not-impede"]
|
|
27
|
+
"enum": ["modality:shall", "modality:may", "modality:shall-if-practicable", "modality:conditional", "modality:exempt", "modality:shall-not", "modality:shall-not-impede"]
|
|
14
28
|
},
|
|
15
29
|
"predicateValue": {
|
|
16
30
|
"oneOf": [
|
|
@@ -81,13 +95,13 @@
|
|
|
81
95
|
},
|
|
82
96
|
"patternProperties": {
|
|
83
97
|
"^fact:[a-z0-9_]+$": { "$ref": "#/$defs/predicateValue" },
|
|
84
|
-
"^(
|
|
98
|
+
"^(self|other):(fact|kin|geo|hist):[a-z0-9_]+$": { "$ref": "#/$defs/predicateValue" },
|
|
85
99
|
"^pair:(geo|env):[a-z0-9_]+$": { "$ref": "#/$defs/predicateValue" }
|
|
86
100
|
}
|
|
87
101
|
},
|
|
88
102
|
"effectRole": {
|
|
89
103
|
"type": "string",
|
|
90
|
-
"enum": ["give-way", "stand-on", "shall-not-impede", "keep-clear", "none"]
|
|
104
|
+
"enum": ["role:give-way", "role:stand-on", "role:shall-not-impede", "role:keep-clear", "role:none"]
|
|
91
105
|
},
|
|
92
106
|
"effect": {
|
|
93
107
|
"oneOf": [
|
|
@@ -108,9 +122,9 @@
|
|
|
108
122
|
{
|
|
109
123
|
"type": "object",
|
|
110
124
|
"additionalProperties": false,
|
|
111
|
-
"required": ["
|
|
125
|
+
"required": ["self", "other"],
|
|
112
126
|
"properties": {
|
|
113
|
-
"
|
|
127
|
+
"self": { "$ref": "#/$defs/effectRole" },
|
|
114
128
|
"other": { "$ref": "#/$defs/effectRole" }
|
|
115
129
|
}
|
|
116
130
|
},
|
|
@@ -121,7 +135,7 @@
|
|
|
121
135
|
"properties": {
|
|
122
136
|
"encounter": {
|
|
123
137
|
"type": "string",
|
|
124
|
-
"enum": ["head-on", "crossing", "overtaking", "none"]
|
|
138
|
+
"enum": ["encounter:head-on", "encounter:crossing", "encounter:overtaking", "encounter:none"]
|
|
125
139
|
}
|
|
126
140
|
}
|
|
127
141
|
},
|
|
@@ -174,20 +188,20 @@
|
|
|
174
188
|
"one_of": {
|
|
175
189
|
"type": "array",
|
|
176
190
|
"minItems": 2,
|
|
177
|
-
"items": { "$ref": "#/$defs/
|
|
191
|
+
"items": { "$ref": "#/$defs/ruleId" }
|
|
178
192
|
},
|
|
179
193
|
"rel:includes": {
|
|
180
194
|
"type": "array",
|
|
181
195
|
"minItems": 1,
|
|
182
|
-
"items": { "$ref": "#/$defs/
|
|
196
|
+
"items": { "$ref": "#/$defs/ruleId" }
|
|
183
197
|
},
|
|
184
198
|
"cite": { "type": "string", "minLength": 1 }
|
|
185
199
|
}
|
|
186
200
|
},
|
|
187
|
-
"
|
|
201
|
+
"ruleIdList": {
|
|
188
202
|
"type": "array",
|
|
189
203
|
"minItems": 1,
|
|
190
|
-
"items": { "$ref": "#/$defs/
|
|
204
|
+
"items": { "$ref": "#/$defs/ruleId" }
|
|
191
205
|
}
|
|
192
206
|
},
|
|
193
207
|
"properties": {
|
|
@@ -216,48 +230,48 @@
|
|
|
216
230
|
"type": "object",
|
|
217
231
|
"additionalProperties": false,
|
|
218
232
|
"required": [
|
|
219
|
-
"shall",
|
|
220
|
-
"may",
|
|
221
|
-
"shall-if-practicable",
|
|
222
|
-
"conditional",
|
|
223
|
-
"exempt",
|
|
224
|
-
"shall-not",
|
|
225
|
-
"shall-not-impede"
|
|
233
|
+
"modality:shall",
|
|
234
|
+
"modality:may",
|
|
235
|
+
"modality:shall-if-practicable",
|
|
236
|
+
"modality:conditional",
|
|
237
|
+
"modality:exempt",
|
|
238
|
+
"modality:shall-not",
|
|
239
|
+
"modality:shall-not-impede"
|
|
226
240
|
],
|
|
227
241
|
"properties": {
|
|
228
|
-
"shall": { "type": "string" },
|
|
229
|
-
"may": { "type": "string" },
|
|
230
|
-
"shall-if-practicable": { "type": "string" },
|
|
231
|
-
"conditional": { "type": "string" },
|
|
232
|
-
"exempt": { "type": "string" },
|
|
233
|
-
"shall-not": { "type": "string" },
|
|
234
|
-
"shall-not-impede": { "type": "string" }
|
|
242
|
+
"modality:shall": { "type": "string" },
|
|
243
|
+
"modality:may": { "type": "string" },
|
|
244
|
+
"modality:shall-if-practicable": { "type": "string" },
|
|
245
|
+
"modality:conditional": { "type": "string" },
|
|
246
|
+
"modality:exempt": { "type": "string" },
|
|
247
|
+
"modality:shall-not": { "type": "string" },
|
|
248
|
+
"modality:shall-not-impede": { "type": "string" }
|
|
235
249
|
}
|
|
236
250
|
},
|
|
237
251
|
"categories": {
|
|
238
252
|
"type": "object",
|
|
239
253
|
"additionalProperties": false,
|
|
240
254
|
"required": [
|
|
241
|
-
"definition",
|
|
242
|
-
"standard",
|
|
243
|
-
"scope",
|
|
244
|
-
"display",
|
|
245
|
-
"classification",
|
|
246
|
-
"precedence",
|
|
247
|
-
"conduct",
|
|
248
|
-
"care",
|
|
249
|
-
"meta"
|
|
255
|
+
"category:definition",
|
|
256
|
+
"category:standard",
|
|
257
|
+
"category:scope",
|
|
258
|
+
"category:display",
|
|
259
|
+
"category:classification",
|
|
260
|
+
"category:precedence",
|
|
261
|
+
"category:conduct",
|
|
262
|
+
"category:care",
|
|
263
|
+
"category:meta"
|
|
250
264
|
],
|
|
251
265
|
"properties": {
|
|
252
|
-
"definition": { "type": "string" },
|
|
253
|
-
"standard": { "type": "string" },
|
|
254
|
-
"scope": { "type": "string" },
|
|
255
|
-
"display": { "type": "string" },
|
|
256
|
-
"classification": { "type": "string" },
|
|
257
|
-
"precedence": { "type": "string" },
|
|
258
|
-
"conduct": { "type": "string" },
|
|
259
|
-
"care": { "type": "string" },
|
|
260
|
-
"meta": { "type": "string" }
|
|
266
|
+
"category:definition": { "type": "string" },
|
|
267
|
+
"category:standard": { "type": "string" },
|
|
268
|
+
"category:scope": { "type": "string" },
|
|
269
|
+
"category:display": { "type": "string" },
|
|
270
|
+
"category:classification": { "type": "string" },
|
|
271
|
+
"category:precedence": { "type": "string" },
|
|
272
|
+
"category:conduct": { "type": "string" },
|
|
273
|
+
"category:care": { "type": "string" },
|
|
274
|
+
"category:meta": { "type": "string" }
|
|
261
275
|
}
|
|
262
276
|
},
|
|
263
277
|
"effects": {
|
|
@@ -269,24 +283,24 @@
|
|
|
269
283
|
"roles": {
|
|
270
284
|
"type": "object",
|
|
271
285
|
"additionalProperties": false,
|
|
272
|
-
"required": ["give-way", "stand-on", "shall-not-impede", "keep-clear", "none"],
|
|
286
|
+
"required": ["role:give-way", "role:stand-on", "role:shall-not-impede", "role:keep-clear", "role:none"],
|
|
273
287
|
"properties": {
|
|
274
|
-
"give-way": { "type": "string" },
|
|
275
|
-
"stand-on": { "type": "string" },
|
|
276
|
-
"shall-not-impede": { "type": "string" },
|
|
277
|
-
"keep-clear": { "type": "string" },
|
|
278
|
-
"none": { "type": "string" }
|
|
288
|
+
"role:give-way": { "type": "string" },
|
|
289
|
+
"role:stand-on": { "type": "string" },
|
|
290
|
+
"role:shall-not-impede": { "type": "string" },
|
|
291
|
+
"role:keep-clear": { "type": "string" },
|
|
292
|
+
"role:none": { "type": "string" }
|
|
279
293
|
}
|
|
280
294
|
},
|
|
281
295
|
"encounters": {
|
|
282
296
|
"type": "object",
|
|
283
297
|
"additionalProperties": false,
|
|
284
|
-
"required": ["head-on", "crossing", "overtaking", "none"],
|
|
298
|
+
"required": ["encounter:head-on", "encounter:crossing", "encounter:overtaking", "encounter:none"],
|
|
285
299
|
"properties": {
|
|
286
|
-
"head-on": { "type": "string" },
|
|
287
|
-
"crossing": { "type": "string" },
|
|
288
|
-
"overtaking": { "type": "string" },
|
|
289
|
-
"none": { "type": "string" }
|
|
300
|
+
"encounter:head-on": { "type": "string" },
|
|
301
|
+
"encounter:crossing": { "type": "string" },
|
|
302
|
+
"encounter:overtaking": { "type": "string" },
|
|
303
|
+
"encounter:none": { "type": "string" }
|
|
290
304
|
}
|
|
291
305
|
},
|
|
292
306
|
"classification_shape": { "type": "string" }
|
|
@@ -312,27 +326,14 @@
|
|
|
312
326
|
"additionalProperties": false,
|
|
313
327
|
"required": ["id", "jurisdiction", "cite", "category", "note"],
|
|
314
328
|
"properties": {
|
|
315
|
-
"id": { "$ref": "#/$defs/
|
|
329
|
+
"id": { "$ref": "#/$defs/ruleId" },
|
|
316
330
|
"jurisdiction": { "type": "string", "pattern": "^[a-z]+(/[a-z]+)*$" },
|
|
317
331
|
"cite": { "type": "string", "minLength": 1 },
|
|
318
|
-
"category": { "type": "string", "enum": ["care", "meta"] },
|
|
332
|
+
"category": { "type": "string", "enum": ["category:care", "category:meta"] },
|
|
319
333
|
"note": { "type": "string", "minLength": 1 }
|
|
320
334
|
}
|
|
321
335
|
}
|
|
322
336
|
},
|
|
323
|
-
"retired_entry_ids": {
|
|
324
|
-
"type": "object",
|
|
325
|
-
"additionalProperties": false,
|
|
326
|
-
"required": ["ids"],
|
|
327
|
-
"properties": {
|
|
328
|
-
"note": { "type": "string" },
|
|
329
|
-
"ids": {
|
|
330
|
-
"type": "object",
|
|
331
|
-
"propertyNames": { "$ref": "#/$defs/entryId" },
|
|
332
|
-
"additionalProperties": { "type": "string", "minLength": 1 }
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
},
|
|
336
337
|
"entries": {
|
|
337
338
|
"type": "array",
|
|
338
339
|
"minItems": 1,
|
|
@@ -341,12 +342,11 @@
|
|
|
341
342
|
"additionalProperties": false,
|
|
342
343
|
"required": ["id", "jurisdiction", "cite", "when", "modality"],
|
|
343
344
|
"properties": {
|
|
344
|
-
"id": { "$ref": "#/$defs/
|
|
345
|
+
"id": { "$ref": "#/$defs/ruleId" },
|
|
345
346
|
"jurisdiction": { "type": "string", "pattern": "^[a-z]+(/[a-z]+)*$" },
|
|
346
347
|
"cite": { "type": "string", "minLength": 1 },
|
|
347
348
|
"category": {
|
|
348
|
-
"
|
|
349
|
-
"enum": ["definition", "standard", "scope", "display", "classification", "precedence", "conduct", "care", "meta"]
|
|
349
|
+
"$ref": "#/$defs/ruleCategory"
|
|
350
350
|
},
|
|
351
351
|
"subjects": { "type": "integer", "const": 2 },
|
|
352
352
|
"when": { "$ref": "#/$defs/situationWhen" },
|
|
@@ -366,16 +366,16 @@
|
|
|
366
366
|
"note": { "type": "string" },
|
|
367
367
|
"gap": { "type": "string", "minLength": 1 },
|
|
368
368
|
"no_gate_note": { "type": "string", "minLength": 1 },
|
|
369
|
-
"rel:includes": { "$ref": "#/$defs/
|
|
369
|
+
"rel:includes": { "$ref": "#/$defs/ruleIdList" },
|
|
370
370
|
"rel:conditional_includes": {
|
|
371
371
|
"type": "array",
|
|
372
372
|
"minItems": 1,
|
|
373
373
|
"items": { "$ref": "#/$defs/conditionalInclude" }
|
|
374
374
|
},
|
|
375
|
-
"rel:in_lieu_of": { "$ref": "#/$defs/
|
|
376
|
-
"rel:excludes": { "$ref": "#/$defs/
|
|
377
|
-
"rel:exempts": { "$ref": "#/$defs/
|
|
378
|
-
"rel:overrides": { "$ref": "#/$defs/
|
|
375
|
+
"rel:in_lieu_of": { "$ref": "#/$defs/ruleIdList" },
|
|
376
|
+
"rel:excludes": { "$ref": "#/$defs/ruleIdList" },
|
|
377
|
+
"rel:exempts": { "$ref": "#/$defs/ruleIdList" },
|
|
378
|
+
"rel:overrides": { "$ref": "#/$defs/ruleIdList" }
|
|
379
379
|
},
|
|
380
380
|
"allOf": [
|
|
381
381
|
{
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/mark-brannan/colregs/schema/conduct-evaluation.schema.json",
|
|
4
|
+
"title": "ConductEvaluation",
|
|
5
|
+
"description": "The result of evaluateConduct: one verdict per applied conduct entry per subject over the window the caller handed over, and the Rule 13(d)/17 phase changes seen (ADR 0012 §3, ADR 0014). Structure only.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"colregs",
|
|
10
|
+
"window",
|
|
11
|
+
"applied",
|
|
12
|
+
"verdicts",
|
|
13
|
+
"phases"
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"colregs": {
|
|
17
|
+
"$ref": "evaluation.schema.json#/$defs/colregs"
|
|
18
|
+
},
|
|
19
|
+
"window": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"additionalProperties": false,
|
|
22
|
+
"required": [
|
|
23
|
+
"from_s",
|
|
24
|
+
"to_s",
|
|
25
|
+
"samples"
|
|
26
|
+
],
|
|
27
|
+
"properties": {
|
|
28
|
+
"from_s": {
|
|
29
|
+
"type": "number"
|
|
30
|
+
},
|
|
31
|
+
"to_s": {
|
|
32
|
+
"type": "number"
|
|
33
|
+
},
|
|
34
|
+
"samples": {
|
|
35
|
+
"type": "integer",
|
|
36
|
+
"minimum": 1
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"applied": {
|
|
41
|
+
"$ref": "evaluation.schema.json#/$defs/ruleIds"
|
|
42
|
+
},
|
|
43
|
+
"verdicts": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": {
|
|
46
|
+
"$ref": "#/$defs/verdict"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"phases": {
|
|
50
|
+
"type": "array",
|
|
51
|
+
"items": {
|
|
52
|
+
"$ref": "#/$defs/phaseChange"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"$defs": {
|
|
57
|
+
"subject": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"enum": [
|
|
60
|
+
"self",
|
|
61
|
+
"other"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"verdict": {
|
|
65
|
+
"$comment": "`pending`: the window ended before the duty could be judged. An entry that never attached is absent, not pending.",
|
|
66
|
+
"type": "object",
|
|
67
|
+
"additionalProperties": false,
|
|
68
|
+
"required": [
|
|
69
|
+
"id",
|
|
70
|
+
"subject",
|
|
71
|
+
"verdict"
|
|
72
|
+
],
|
|
73
|
+
"properties": {
|
|
74
|
+
"id": {
|
|
75
|
+
"$ref": "evaluation.schema.json#/$defs/ruleId"
|
|
76
|
+
},
|
|
77
|
+
"subject": {
|
|
78
|
+
"$ref": "#/$defs/subject"
|
|
79
|
+
},
|
|
80
|
+
"verdict": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"enum": [
|
|
83
|
+
"kept",
|
|
84
|
+
"breached",
|
|
85
|
+
"pending"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
"attached_at_s": {
|
|
89
|
+
"type": "number"
|
|
90
|
+
},
|
|
91
|
+
"decided_at_s": {
|
|
92
|
+
"type": "number"
|
|
93
|
+
},
|
|
94
|
+
"robustness": {
|
|
95
|
+
"type": "object",
|
|
96
|
+
"additionalProperties": false,
|
|
97
|
+
"required": [
|
|
98
|
+
"value",
|
|
99
|
+
"unit"
|
|
100
|
+
],
|
|
101
|
+
"properties": {
|
|
102
|
+
"value": {
|
|
103
|
+
"type": "number"
|
|
104
|
+
},
|
|
105
|
+
"unit": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"minLength": 1
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"phaseChange": {
|
|
114
|
+
"$comment": "`phase` is a paragraph cite, never an entry id: several phases have no entry.",
|
|
115
|
+
"type": "object",
|
|
116
|
+
"additionalProperties": false,
|
|
117
|
+
"required": [
|
|
118
|
+
"subject",
|
|
119
|
+
"phase",
|
|
120
|
+
"at_s"
|
|
121
|
+
],
|
|
122
|
+
"properties": {
|
|
123
|
+
"subject": {
|
|
124
|
+
"$ref": "#/$defs/subject"
|
|
125
|
+
},
|
|
126
|
+
"phase": {
|
|
127
|
+
"$ref": "evaluation.schema.json#/$defs/paragraphCite"
|
|
128
|
+
},
|
|
129
|
+
"at_s": {
|
|
130
|
+
"type": "number"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/mark-brannan/colregs/schema/display-evaluation.schema.json",
|
|
4
|
+
"title": "DisplayEvaluation",
|
|
5
|
+
"description": "The result of evaluateDisplay: every complete lawful display for one vessel, alternatives unresolved (REQ-MODEL-8), with the data it was read against (ADR 0011 §1, ADR 0014). Structure only; the $defs shared with the other envelopes live in schema/evaluation.schema.json.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"colregs",
|
|
10
|
+
"applied",
|
|
11
|
+
"exempted",
|
|
12
|
+
"excluded",
|
|
13
|
+
"overridden",
|
|
14
|
+
"displays",
|
|
15
|
+
"optional_additions",
|
|
16
|
+
"modalities",
|
|
17
|
+
"categories",
|
|
18
|
+
"provenance"
|
|
19
|
+
],
|
|
20
|
+
"properties": {
|
|
21
|
+
"colregs": {
|
|
22
|
+
"$ref": "evaluation.schema.json#/$defs/colregs"
|
|
23
|
+
},
|
|
24
|
+
"applied": {
|
|
25
|
+
"$ref": "evaluation.schema.json#/$defs/ruleIds"
|
|
26
|
+
},
|
|
27
|
+
"exempted": {
|
|
28
|
+
"$ref": "evaluation.schema.json#/$defs/byEntryList"
|
|
29
|
+
},
|
|
30
|
+
"excluded": {
|
|
31
|
+
"$ref": "evaluation.schema.json#/$defs/byEntryList"
|
|
32
|
+
},
|
|
33
|
+
"overridden": {
|
|
34
|
+
"$ref": "evaluation.schema.json#/$defs/byEntryList"
|
|
35
|
+
},
|
|
36
|
+
"displays": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"items": {
|
|
39
|
+
"$ref": "#/$defs/display"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"optional_additions": {
|
|
43
|
+
"type": "array",
|
|
44
|
+
"items": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": [
|
|
48
|
+
"id",
|
|
49
|
+
"lights",
|
|
50
|
+
"cite"
|
|
51
|
+
],
|
|
52
|
+
"properties": {
|
|
53
|
+
"id": {
|
|
54
|
+
"$ref": "evaluation.schema.json#/$defs/ruleId"
|
|
55
|
+
},
|
|
56
|
+
"via": {
|
|
57
|
+
"$ref": "evaluation.schema.json#/$defs/ruleId"
|
|
58
|
+
},
|
|
59
|
+
"lights": {
|
|
60
|
+
"type": "array",
|
|
61
|
+
"items": {
|
|
62
|
+
"$ref": "#/$defs/displayLight"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"cite": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"minLength": 1
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"optionalAdditions": {
|
|
73
|
+
"deprecated": true,
|
|
74
|
+
"$comment": "Renamed to optional_additions (ADR 0011 §4); an implementation may still emit both.",
|
|
75
|
+
"type": "array",
|
|
76
|
+
"items": {
|
|
77
|
+
"$ref": "#/properties/optional_additions/items"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"modalities": {
|
|
81
|
+
"$ref": "evaluation.schema.json#/$defs/modalities"
|
|
82
|
+
},
|
|
83
|
+
"categories": {
|
|
84
|
+
"$ref": "evaluation.schema.json#/$defs/categories"
|
|
85
|
+
},
|
|
86
|
+
"provenance": {
|
|
87
|
+
"$ref": "evaluation.schema.json#/$defs/provenance"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"$defs": {
|
|
91
|
+
"displayLight": {
|
|
92
|
+
"type": "object",
|
|
93
|
+
"additionalProperties": false,
|
|
94
|
+
"required": [
|
|
95
|
+
"spec",
|
|
96
|
+
"source_entry",
|
|
97
|
+
"modality"
|
|
98
|
+
],
|
|
99
|
+
"properties": {
|
|
100
|
+
"spec": {
|
|
101
|
+
"$ref": "applicability.schema.json#/$defs/lightRef"
|
|
102
|
+
},
|
|
103
|
+
"source_entry": {
|
|
104
|
+
"$ref": "evaluation.schema.json#/$defs/ruleId"
|
|
105
|
+
},
|
|
106
|
+
"sourceEntry": {
|
|
107
|
+
"deprecated": true,
|
|
108
|
+
"$comment": "Renamed to source_entry (ADR 0011 §4).",
|
|
109
|
+
"$ref": "evaluation.schema.json#/$defs/ruleId"
|
|
110
|
+
},
|
|
111
|
+
"via": {
|
|
112
|
+
"$ref": "evaluation.schema.json#/$defs/ruleId"
|
|
113
|
+
},
|
|
114
|
+
"modality": {
|
|
115
|
+
"$ref": "applicability.schema.json#/$defs/modality"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"display": {
|
|
120
|
+
"type": "object",
|
|
121
|
+
"additionalProperties": false,
|
|
122
|
+
"required": [
|
|
123
|
+
"entries",
|
|
124
|
+
"lights",
|
|
125
|
+
"chosen"
|
|
126
|
+
],
|
|
127
|
+
"properties": {
|
|
128
|
+
"entries": {
|
|
129
|
+
"$ref": "evaluation.schema.json#/$defs/ruleIds"
|
|
130
|
+
},
|
|
131
|
+
"lights": {
|
|
132
|
+
"type": "array",
|
|
133
|
+
"items": {
|
|
134
|
+
"$ref": "#/$defs/displayLight"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"chosen": {
|
|
138
|
+
"type": "array",
|
|
139
|
+
"items": {
|
|
140
|
+
"type": "string"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|