colregs 0.3.0 → 0.3.1
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 +8 -6
- package/data/applicability.json +219 -244
- package/data/facts.json +4 -4
- 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 +1 -1
- 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/budgets.json +5 -15
- package/docs/identifiers.md +49 -51
- package/docs/maritime-sources.md +58 -0
- package/docs/normative-language.md +103 -0
- package/docs/part-b-invariants.md +31 -29
- package/docs/requirements.md +80 -71
- package/fixtures/applicability-fixtures.json +190 -190
- package/fixtures/situation-fixtures.json +287 -287
- package/package.json +1 -1
- package/schema/applicability-fixtures.schema.json +4 -13
- package/schema/applicability.schema.json +27 -27
- 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/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 +10 -146
- 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
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/mark-brannan/colregs/schema/evaluation.schema.json",
|
|
4
|
+
"title": "Evaluation",
|
|
5
|
+
"description": "The $defs every result envelope shares (ADR 0014): the colregs provenance stamp, what an evaluation read, entry-id and paragraph-cite vocabularies. No instance validates against the root; the envelopes under schema/*-evaluation.schema.json and the operations manifest $ref into $defs here.",
|
|
6
|
+
"$defs": {
|
|
7
|
+
"ruleId": {
|
|
8
|
+
"$ref": "applicability.schema.json#/$defs/ruleId"
|
|
9
|
+
},
|
|
10
|
+
"ruleIds": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": {
|
|
13
|
+
"$ref": "#/$defs/ruleId"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"paragraphCite": {
|
|
17
|
+
"$comment": "A Rules paragraph path, the vocabulary of `phase` and `breaches` (ADR 0011 §4); the pattern is data/rules.json's paragraph key, and the tests hold the two equal.",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"pattern": "^[0-9]+(\\([a-z]\\))?(\\([ivx]+\\))?$"
|
|
20
|
+
},
|
|
21
|
+
"colregs": {
|
|
22
|
+
"$comment": "`resolved`: the data is the implementation's own colregs dependency and `version` describes it exactly. `caller`: the caller supplied the data and `version` names only the release the implementation resolved.",
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": [
|
|
26
|
+
"version",
|
|
27
|
+
"source"
|
|
28
|
+
],
|
|
29
|
+
"properties": {
|
|
30
|
+
"version": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"minLength": 1
|
|
33
|
+
},
|
|
34
|
+
"source": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"enum": [
|
|
37
|
+
"resolved",
|
|
38
|
+
"caller"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"byEntry": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"required": [
|
|
47
|
+
"id",
|
|
48
|
+
"by"
|
|
49
|
+
],
|
|
50
|
+
"properties": {
|
|
51
|
+
"id": {
|
|
52
|
+
"$ref": "#/$defs/ruleId"
|
|
53
|
+
},
|
|
54
|
+
"by": {
|
|
55
|
+
"$ref": "#/$defs/ruleId"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"byEntryList": {
|
|
60
|
+
"type": "array",
|
|
61
|
+
"items": {
|
|
62
|
+
"$ref": "#/$defs/byEntry"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"modalities": {
|
|
66
|
+
"type": "object",
|
|
67
|
+
"additionalProperties": false,
|
|
68
|
+
"patternProperties": {
|
|
69
|
+
"^rule:[0-9]+[a-z]?(_[ivx]+)*(:[a-z][a-z0-9_]*)?$": {
|
|
70
|
+
"$ref": "applicability.schema.json#/$defs/modality"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"categories": {
|
|
75
|
+
"type": "object",
|
|
76
|
+
"additionalProperties": false,
|
|
77
|
+
"patternProperties": {
|
|
78
|
+
"^rule:[0-9]+[a-z]?(_[ivx]+)*(:[a-z][a-z0-9_]*)?$": {
|
|
79
|
+
"$ref": "#/$defs/ruleCategory"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"ruleCategory": {
|
|
84
|
+
"$ref": "applicability.schema.json#/$defs/ruleCategory"
|
|
85
|
+
},
|
|
86
|
+
"representedParagraph": {
|
|
87
|
+
"$comment": "One of data/applicability.json's represented_paragraphs without its note: an evaluation carries the identity, not the prose.",
|
|
88
|
+
"type": "object",
|
|
89
|
+
"additionalProperties": false,
|
|
90
|
+
"required": [
|
|
91
|
+
"id",
|
|
92
|
+
"jurisdiction",
|
|
93
|
+
"cite",
|
|
94
|
+
"category"
|
|
95
|
+
],
|
|
96
|
+
"properties": {
|
|
97
|
+
"id": {
|
|
98
|
+
"$ref": "applicability.schema.json#/$defs/ruleId"
|
|
99
|
+
},
|
|
100
|
+
"jurisdiction": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"pattern": "^[a-z]+(/[a-z]+)*$"
|
|
103
|
+
},
|
|
104
|
+
"cite": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"minLength": 1
|
|
107
|
+
},
|
|
108
|
+
"category": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"enum": [
|
|
111
|
+
"care",
|
|
112
|
+
"meta"
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"provenance": {
|
|
118
|
+
"$comment": "What an evaluation read, and therefore what its answer does not cover: the categories it matched, the jurisdictions offered, and the paragraphs no verb computes.",
|
|
119
|
+
"type": "object",
|
|
120
|
+
"additionalProperties": false,
|
|
121
|
+
"required": [
|
|
122
|
+
"evaluated_categories",
|
|
123
|
+
"jurisdictions",
|
|
124
|
+
"represented"
|
|
125
|
+
],
|
|
126
|
+
"properties": {
|
|
127
|
+
"evaluated_categories": {
|
|
128
|
+
"type": "array",
|
|
129
|
+
"items": {
|
|
130
|
+
"$ref": "#/$defs/ruleCategory"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"jurisdictions": {
|
|
134
|
+
"type": "array",
|
|
135
|
+
"items": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"pattern": "^[a-z]+(/[a-z]+)*$"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"represented": {
|
|
141
|
+
"type": "array",
|
|
142
|
+
"items": {
|
|
143
|
+
"$ref": "#/$defs/representedParagraph"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/mark-brannan/colregs/schema/fact-record.schema.json",
|
|
4
|
+
"title": "FactRecord",
|
|
5
|
+
"description": "What a consumer asserts about one vessel at one moment: the input evaluateDisplay reads (ADR 0011 §2, ADR 0014). Structure only -- which fact keys exist and which values each takes is data/facts.json's, checked in the tests; see docs/adr/0006-json-schema-and-identifier-diff.md.",
|
|
6
|
+
"$comment": "A case's `facts` in schema/applicability-fixtures.schema.json is this shape plus minProperties: 1 -- a fixture must assert something; an evaluation input need not, and `{}` is a record that asserts nothing. Values are string, number or boolean, as data/facts.json declares them; null and positions belong to the situation classes.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"patternProperties": {
|
|
10
|
+
"^fact:[a-z0-9_]+$": {
|
|
11
|
+
"$ref": "#/$defs/factValue"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"$defs": {
|
|
15
|
+
"factValue": {
|
|
16
|
+
"oneOf": [
|
|
17
|
+
{
|
|
18
|
+
"type": "string",
|
|
19
|
+
"pattern": "^[a-z][a-z0-9_]*:[a-z0-9_]+$"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"type": "number"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"type": "boolean"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/mark-brannan/colregs/schema/i18n-catalog.schema.json",
|
|
4
|
+
"title": "data/i18n/*.json",
|
|
5
|
+
"description": "Display catalog for one BCP 47 language: UI strings for identifier vocabularies (light names, fact-axis labels, modality labels, image captions), not legal text -- see docs/adr/0003-language-as-a-dimension.md 'Display catalogs'.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["language", "provenance", "strings"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"language": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"pattern": "^[a-z]{2,3}(-[A-Za-z0-9]+)*$",
|
|
13
|
+
"description": "BCP 47 tag, e.g. en, fi. Must equal the filename stem; test/data.test.mjs checks."
|
|
14
|
+
},
|
|
15
|
+
"provenance": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"required": ["contributors", "reviewed_by", "review_date"],
|
|
19
|
+
"properties": {
|
|
20
|
+
"contributors": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
|
|
21
|
+
"reviewed_by": { "type": "array", "items": { "type": "string" }, "description": "Named human reviewers. Empty means unreviewed: the strings are on file but not yet vouched for." },
|
|
22
|
+
"review_date": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
23
|
+
"licence": { "type": "string", "description": "Optional until the data licence question (Q-9) is ruled; absent means the package licence applies." }
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"strings": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"description": "One section per vocabulary. Identifier vocabularies (light) are keyed by the identifier itself, as documented in docs/identifiers.md; closed vocabularies (modality) by their bare value, as stored in data/applicability.json. Values are static strings: no interpolation, no plurals -- the consumer's i18n system owns composition.",
|
|
29
|
+
"additionalProperties": false,
|
|
30
|
+
"properties": {
|
|
31
|
+
"light": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"propertyNames": { "pattern": "^light:[a-z_]+$" },
|
|
34
|
+
"additionalProperties": { "$ref": "#/$defs/label" }
|
|
35
|
+
},
|
|
36
|
+
"modality": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"propertyNames": { "pattern": "^[a-z]+(-[a-z]+)*$" },
|
|
39
|
+
"additionalProperties": { "$ref": "#/$defs/label" }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"$defs": {
|
|
45
|
+
"label": { "type": "string", "minLength": 1 }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/mark-brannan/colregs/schema/operations.schema.json",
|
|
4
|
+
"title": "data/operations.json",
|
|
5
|
+
"description": "The engine interface colregs owns (ADR 0014): one operation per verb ADR 0011 and ADR 0012 name, each binding its positional inputs and its result to a schema under schema/, its entry-id companion, and the fixture cases that exercise it. Structure only -- that every schema reference resolves and every fixture file is bound is checked in the tests.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"operations"
|
|
10
|
+
],
|
|
11
|
+
"$defs": {
|
|
12
|
+
"verb": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"pattern": "^[a-z][A-Za-z0-9]*$"
|
|
15
|
+
},
|
|
16
|
+
"schemaRef": {
|
|
17
|
+
"$comment": "A file under schema/, optionally with a JSON pointer into it; relative to the package root.",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"pattern": "^schema/[a-z0-9-]+\\.schema\\.json(#/[^#]+)?$"
|
|
20
|
+
},
|
|
21
|
+
"adr": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"pattern": "^[0-9]{4}$"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"properties": {
|
|
27
|
+
"note": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"operations": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"additionalProperties": false,
|
|
33
|
+
"minProperties": 1,
|
|
34
|
+
"patternProperties": {
|
|
35
|
+
"^[a-z][A-Za-z0-9]*$": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"additionalProperties": false,
|
|
38
|
+
"required": [
|
|
39
|
+
"adr",
|
|
40
|
+
"inputs",
|
|
41
|
+
"output",
|
|
42
|
+
"fixtures"
|
|
43
|
+
],
|
|
44
|
+
"properties": {
|
|
45
|
+
"adr": {
|
|
46
|
+
"$ref": "#/$defs/adr"
|
|
47
|
+
},
|
|
48
|
+
"inputs": {
|
|
49
|
+
"$comment": "Positional, in call order. Anything a binding accepts after them (an options bag, a data override) is the binding's own and is not named here.",
|
|
50
|
+
"type": "array",
|
|
51
|
+
"minItems": 1,
|
|
52
|
+
"items": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"additionalProperties": false,
|
|
55
|
+
"required": [
|
|
56
|
+
"name",
|
|
57
|
+
"schema"
|
|
58
|
+
],
|
|
59
|
+
"properties": {
|
|
60
|
+
"name": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"pattern": "^[a-z][a-z0-9_]*$"
|
|
63
|
+
},
|
|
64
|
+
"schema": {
|
|
65
|
+
"$ref": "#/$defs/schemaRef"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"output": {
|
|
71
|
+
"$ref": "#/$defs/schemaRef"
|
|
72
|
+
},
|
|
73
|
+
"companion": {
|
|
74
|
+
"$comment": "The verb that takes the same inputs and answers only the applied entry ids -- the fixture contract, since every fixture case `expect`s entry ids.",
|
|
75
|
+
"type": "object",
|
|
76
|
+
"additionalProperties": false,
|
|
77
|
+
"required": [
|
|
78
|
+
"verb",
|
|
79
|
+
"output"
|
|
80
|
+
],
|
|
81
|
+
"properties": {
|
|
82
|
+
"verb": {
|
|
83
|
+
"$ref": "#/$defs/verb"
|
|
84
|
+
},
|
|
85
|
+
"output": {
|
|
86
|
+
"$ref": "#/$defs/schemaRef"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"fixtures": {
|
|
91
|
+
"$comment": "Each binds a fixture file whose `cases[]` carry this operation's inputs, in order, under the `case_inputs` keys, and the expected answer under `expect` -- the companion's entry ids unless `expect` names another schema. A case's `status` and `jurisdiction` are the fixture file's own and are read there. Empty until a fixture file for the input exists.",
|
|
92
|
+
"type": "array",
|
|
93
|
+
"items": {
|
|
94
|
+
"type": "object",
|
|
95
|
+
"additionalProperties": false,
|
|
96
|
+
"required": [
|
|
97
|
+
"file",
|
|
98
|
+
"case_inputs"
|
|
99
|
+
],
|
|
100
|
+
"properties": {
|
|
101
|
+
"file": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"pattern": "^fixtures/[a-z0-9-]+\\.json$"
|
|
104
|
+
},
|
|
105
|
+
"case_inputs": {
|
|
106
|
+
"type": "array",
|
|
107
|
+
"minItems": 1,
|
|
108
|
+
"items": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"pattern": "^[a-z][a-z0-9_]*$"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"expect": {
|
|
114
|
+
"$ref": "#/$defs/schemaRef"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/mark-brannan/colregs/schema/rule2-departure-finding.schema.json",
|
|
4
|
+
"title": "Rule2DepartureFinding",
|
|
5
|
+
"description": "The result of evaluateRule2Departure: what a named grid found for a situation, with the rule-derived obligations unchanged beside it and the model that made the claim (ADR 0012 §4, ADR 0014). Advisories are ranked best margin first and are empty under no-robust-policy-in-model. Structure only.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"status",
|
|
10
|
+
"rules",
|
|
11
|
+
"advisories",
|
|
12
|
+
"model"
|
|
13
|
+
],
|
|
14
|
+
"properties": {
|
|
15
|
+
"status": {
|
|
16
|
+
"$ref": "rule2-departure-model.schema.json#/$defs/status"
|
|
17
|
+
},
|
|
18
|
+
"rules": {
|
|
19
|
+
"$ref": "encounter-evaluation.schema.json"
|
|
20
|
+
},
|
|
21
|
+
"advisories": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"items": {
|
|
24
|
+
"$ref": "rule2-departure-model.schema.json#/$defs/advisory"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"model": {
|
|
28
|
+
"$comment": "`version` names the grid, `colregs_version` the release it was solved against; a mismatch with rules.colregs.version is reported, not refused. `assumptions_violated` is display text, never matched on.",
|
|
29
|
+
"type": "object",
|
|
30
|
+
"additionalProperties": false,
|
|
31
|
+
"required": [
|
|
32
|
+
"version",
|
|
33
|
+
"colregs_version",
|
|
34
|
+
"parameters",
|
|
35
|
+
"assumptions_violated"
|
|
36
|
+
],
|
|
37
|
+
"properties": {
|
|
38
|
+
"version": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"minLength": 1
|
|
41
|
+
},
|
|
42
|
+
"colregs_version": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"minLength": 1
|
|
45
|
+
},
|
|
46
|
+
"parameters": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"allOf": [
|
|
49
|
+
{
|
|
50
|
+
"$ref": "rule2-departure-model.schema.json#/$defs/solverParameters"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"required": [
|
|
54
|
+
"dynamics",
|
|
55
|
+
"horizon_s",
|
|
56
|
+
"cadence_s",
|
|
57
|
+
"separation_m",
|
|
58
|
+
"information",
|
|
59
|
+
"adversary"
|
|
60
|
+
],
|
|
61
|
+
"unevaluatedProperties": false
|
|
62
|
+
},
|
|
63
|
+
"assumptions_violated": {
|
|
64
|
+
"type": "array",
|
|
65
|
+
"items": {
|
|
66
|
+
"type": "string"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/mark-brannan/colregs/schema/rule2-departure-model.schema.json",
|
|
4
|
+
"title": "Rule2DepartureModel",
|
|
5
|
+
"description": "One solved region grid, named immutably by `version`, the positional second input of evaluateRule2Departure (ADR 0012 §4, ADR 0014). Only `version`, `colregs_version`, the solver parameters and the `regions` encoding are API; any other field is the artefact's own, so additional properties are allowed. Structure only.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"version",
|
|
9
|
+
"colregs_version",
|
|
10
|
+
"dynamics",
|
|
11
|
+
"horizon_s",
|
|
12
|
+
"cadence_s",
|
|
13
|
+
"separation_m",
|
|
14
|
+
"information",
|
|
15
|
+
"adversary"
|
|
16
|
+
],
|
|
17
|
+
"allOf": [
|
|
18
|
+
{
|
|
19
|
+
"$ref": "#/$defs/solverParameters"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"properties": {
|
|
23
|
+
"version": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"minLength": 1
|
|
26
|
+
},
|
|
27
|
+
"colregs_version": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"minLength": 1
|
|
30
|
+
},
|
|
31
|
+
"regions": {
|
|
32
|
+
"type": "array",
|
|
33
|
+
"items": {
|
|
34
|
+
"$ref": "#/$defs/region"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"$defs": {
|
|
39
|
+
"solverParameters": {
|
|
40
|
+
"$comment": "The axes the Rule 2 sensitivity matrix varies (colregs Q-17 to Q-22); the field set is a claim about what that matrix is.",
|
|
41
|
+
"type": "object",
|
|
42
|
+
"properties": {
|
|
43
|
+
"dynamics": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": {
|
|
46
|
+
"type": "string"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"horizon_s": {
|
|
50
|
+
"type": "number"
|
|
51
|
+
},
|
|
52
|
+
"cadence_s": {
|
|
53
|
+
"type": "number"
|
|
54
|
+
},
|
|
55
|
+
"separation_m": {
|
|
56
|
+
"type": "number"
|
|
57
|
+
},
|
|
58
|
+
"information": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"enum": [
|
|
61
|
+
"full",
|
|
62
|
+
"partial"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"adversary": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"enum": [
|
|
68
|
+
"compliant",
|
|
69
|
+
"physics"
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"status": {
|
|
75
|
+
"$comment": "The status alphabet is colregs' (ADR 0005 §5), not an engine's to rename: not-flagged, model-rule-conflict and no-robust-policy-in-model name R0, R1 and R2; inconclusive-in-model names none.",
|
|
76
|
+
"type": "string",
|
|
77
|
+
"enum": [
|
|
78
|
+
"not-flagged",
|
|
79
|
+
"model-rule-conflict",
|
|
80
|
+
"no-robust-policy-in-model",
|
|
81
|
+
"inconclusive-in-model"
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
"advisory": {
|
|
85
|
+
"type": "object",
|
|
86
|
+
"additionalProperties": false,
|
|
87
|
+
"required": [
|
|
88
|
+
"action",
|
|
89
|
+
"margin_m",
|
|
90
|
+
"breaches",
|
|
91
|
+
"envelope"
|
|
92
|
+
],
|
|
93
|
+
"properties": {
|
|
94
|
+
"action": {
|
|
95
|
+
"type": "object",
|
|
96
|
+
"additionalProperties": false,
|
|
97
|
+
"properties": {
|
|
98
|
+
"alter_deg": {
|
|
99
|
+
"type": "number"
|
|
100
|
+
},
|
|
101
|
+
"sog_kn": {
|
|
102
|
+
"type": "number"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"margin_m": {
|
|
107
|
+
"type": "number"
|
|
108
|
+
},
|
|
109
|
+
"breaches": {
|
|
110
|
+
"type": "array",
|
|
111
|
+
"items": {
|
|
112
|
+
"$ref": "evaluation.schema.json#/$defs/paragraphCite"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"envelope": {
|
|
116
|
+
"type": "object",
|
|
117
|
+
"additionalProperties": false,
|
|
118
|
+
"required": [
|
|
119
|
+
"holds_until_s"
|
|
120
|
+
],
|
|
121
|
+
"properties": {
|
|
122
|
+
"holds_until_s": {
|
|
123
|
+
"type": "number"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"region": {
|
|
130
|
+
"$comment": "Regions of situation space as predicates over the flat `<subject>:<class>:<key>` namespace, first match wins, no match is inconclusive-in-model.",
|
|
131
|
+
"type": "object",
|
|
132
|
+
"additionalProperties": false,
|
|
133
|
+
"required": [
|
|
134
|
+
"when",
|
|
135
|
+
"status"
|
|
136
|
+
],
|
|
137
|
+
"properties": {
|
|
138
|
+
"when": {
|
|
139
|
+
"$ref": "applicability.schema.json#/$defs/situationWhen"
|
|
140
|
+
},
|
|
141
|
+
"status": {
|
|
142
|
+
"$ref": "#/$defs/status"
|
|
143
|
+
},
|
|
144
|
+
"advisories": {
|
|
145
|
+
"type": "array",
|
|
146
|
+
"items": {
|
|
147
|
+
"$ref": "#/$defs/advisory"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"assumptions_violated": {
|
|
151
|
+
"type": "array",
|
|
152
|
+
"items": {
|
|
153
|
+
"type": "string"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|