colregs 0.1.0 → 0.2.0

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.
Files changed (34) hide show
  1. package/LICENSE +194 -26
  2. package/PROVENANCE.md +46 -13
  3. package/README.md +324 -20
  4. package/data/applicability.json +1247 -236
  5. package/data/deprecated-identifiers.json +7 -0
  6. package/data/facts.json +549 -112
  7. package/data/geometry.json +34 -34
  8. package/data/images.json +52 -26
  9. package/data/lights.json +36 -36
  10. package/data/rules.json +887 -104
  11. package/docs/adr/0001-name-and-jurisdiction-model.md +194 -0
  12. package/docs/adr/0002-wig-gate-and-jurisdiction-field.md +77 -0
  13. package/docs/adr/0003-language-as-a-dimension.md +220 -0
  14. package/docs/adr/0004-licence-layering.md +78 -0
  15. package/docs/adr/0005-rule-categories-and-the-situation-record.md +323 -0
  16. package/docs/adr/0006-json-schema-and-identifier-diff.md +95 -0
  17. package/docs/conventions.md +27 -0
  18. package/docs/gates.json +84 -0
  19. package/docs/identifiers.md +435 -0
  20. package/docs/requirements.md +1320 -0
  21. package/docs/verification/2026-08-30-q6-q8.md +278 -0
  22. package/docs/verification/2026-09-05-rule27f-rule28-anchor-scenarios.md +330 -0
  23. package/fixtures/applicability-fixtures.json +498 -138
  24. package/fixtures/situation-fixtures.json +3603 -0
  25. package/package.json +27 -5
  26. package/schema/applicability-fixtures.schema.json +47 -0
  27. package/schema/applicability.schema.json +401 -0
  28. package/schema/deprecated-identifiers.schema.json +29 -0
  29. package/schema/facts.schema.json +793 -0
  30. package/schema/geometry.schema.json +239 -0
  31. package/schema/images.schema.json +53 -0
  32. package/schema/lights.schema.json +131 -0
  33. package/schema/rules.schema.json +50 -0
  34. package/schema/situation-fixtures.schema.json +325 -0
@@ -1,15 +1,15 @@
1
1
  {
2
- "ruleset": "international",
2
+ "jurisdiction": "intl",
3
3
  "source": "Annex I - Positioning and Technical Details of Lights and Shapes (33 CFR 84), International text",
4
4
  "note": "The structured half of the image payload: where each light sits and what it looks like, so a renderer can draw a configuration instead of picking a scan. Bearing arcs live in lights.json; this file carries heights, spacings, colour and intensity.",
5
5
  "vertical_positioning": [
6
6
  {
7
7
  "cite": "AnxI.2(a)(i)",
8
- "light": "masthead",
8
+ "light": "light:masthead",
9
9
  "which": "forward (or the only one)",
10
10
  "when": {
11
- "propulsion": "power",
12
- "length_m": {
11
+ "fact:propulsion": "propulsion:power",
12
+ "fact:length_m": {
13
13
  "gte": 20
14
14
  }
15
15
  },
@@ -21,11 +21,11 @@
21
21
  },
22
22
  {
23
23
  "cite": "AnxI.2(a)(ii)",
24
- "light": "masthead",
24
+ "light": "light:masthead",
25
25
  "which": "after",
26
26
  "when": {
27
- "propulsion": "power",
28
- "length_m": {
27
+ "fact:propulsion": "propulsion:power",
28
+ "fact:length_m": {
29
29
  "gte": 20
30
30
  }
31
31
  },
@@ -35,16 +35,16 @@
35
35
  },
36
36
  {
37
37
  "cite": "AnxI.2(b)",
38
- "light": "masthead",
38
+ "light": "light:masthead",
39
39
  "constraint": "separation",
40
40
  "text": "The vertical separation of the masthead lights of power-driven vessels shall be such that in all normal conditions of trim the after light will be seen over and separate from the forward light at a distance of 1000 meters from the stem when viewed from sea level."
41
41
  },
42
42
  {
43
43
  "cite": "AnxI.2(c)",
44
- "light": "masthead",
44
+ "light": "light:masthead",
45
45
  "when": {
46
- "propulsion": "power",
47
- "length_m": {
46
+ "fact:propulsion": "propulsion:power",
47
+ "fact:length_m": {
48
48
  "gte": 12,
49
49
  "lt": 20
50
50
  }
@@ -55,10 +55,10 @@
55
55
  },
56
56
  {
57
57
  "cite": "AnxI.2(d)",
58
- "light": "masthead",
58
+ "light": "light:masthead",
59
59
  "when": {
60
- "propulsion": "power",
61
- "length_m": {
60
+ "fact:propulsion": "propulsion:power",
61
+ "fact:length_m": {
62
62
  "lt": 12
63
63
  }
64
64
  },
@@ -71,11 +71,11 @@
71
71
  },
72
72
  {
73
73
  "cite": "AnxI.2(e)",
74
- "light": "masthead",
74
+ "light": "light:masthead",
75
75
  "when": {
76
- "activity": [
77
- "towing",
78
- "pushing"
76
+ "fact:activity": [
77
+ "activity:towing",
78
+ "activity:pushing"
79
79
  ]
80
80
  },
81
81
  "datum": "forward masthead light",
@@ -84,13 +84,13 @@
84
84
  },
85
85
  {
86
86
  "cite": "AnxI.2(f)(i)",
87
- "light": "masthead",
87
+ "light": "light:masthead",
88
88
  "constraint": "clearance",
89
89
  "text": "The masthead lights or lights prescribed in Rule 23(a) shall be so placed as to be above and clear of all other lights and obstructions except as described in paragraph (f)(ii)."
90
90
  },
91
91
  {
92
92
  "cite": "AnxI.2(f)(ii)",
93
- "light": "all_round",
93
+ "light": "light:all_round",
94
94
  "applies_to_entries": [
95
95
  "27b-id",
96
96
  "28"
@@ -99,9 +99,9 @@
99
99
  },
100
100
  {
101
101
  "cite": "AnxI.2(g)",
102
- "light": "sidelights",
102
+ "light": "light:sidelights",
103
103
  "when": {
104
- "propulsion": "power"
104
+ "fact:propulsion": "propulsion:power"
105
105
  },
106
106
  "datum": "forward masthead light",
107
107
  "max_fraction_of_masthead_height": 0.75,
@@ -109,11 +109,11 @@
109
109
  },
110
110
  {
111
111
  "cite": "AnxI.2(h)",
112
- "light": "sidelights",
112
+ "light": "light:sidelights",
113
113
  "combined": true,
114
114
  "when": {
115
- "propulsion": "power",
116
- "length_m": {
115
+ "fact:propulsion": "propulsion:power",
116
+ "fact:length_m": {
117
117
  "lt": 20
118
118
  }
119
119
  },
@@ -125,7 +125,7 @@
125
125
  "cite": "AnxI.2(i)(i)",
126
126
  "constraint": "vertical line spacing",
127
127
  "when": {
128
- "length_m": {
128
+ "fact:length_m": {
129
129
  "gte": 20
130
130
  }
131
131
  },
@@ -141,7 +141,7 @@
141
141
  "cite": "AnxI.2(i)(ii)",
142
142
  "constraint": "vertical line spacing",
143
143
  "when": {
144
- "length_m": {
144
+ "fact:length_m": {
145
145
  "lt": 20
146
146
  }
147
147
  },
@@ -178,7 +178,7 @@
178
178
  "min_m": 4.5,
179
179
  "also": {
180
180
  "when": {
181
- "length_m": {
181
+ "fact:length_m": {
182
182
  "gte": 50
183
183
  }
184
184
  },
@@ -191,7 +191,7 @@
191
191
  "horizontal_positioning": [
192
192
  {
193
193
  "cite": "AnxI.3(a)",
194
- "light": "masthead",
194
+ "light": "light:masthead",
195
195
  "constraint": "separation",
196
196
  "min_fraction_of_length": 0.25,
197
197
  "need_not_exceed_m": 50,
@@ -200,10 +200,10 @@
200
200
  },
201
201
  {
202
202
  "cite": "AnxI.3(b)",
203
- "light": "sidelights",
203
+ "light": "light:sidelights",
204
204
  "when": {
205
- "propulsion": "power",
206
- "length_m": {
205
+ "fact:propulsion": "propulsion:power",
206
+ "fact:length_m": {
207
207
  "gte": 20
208
208
  }
209
209
  },
@@ -219,7 +219,7 @@
219
219
  },
220
220
  {
221
221
  "cite": "AnxI.3(d)",
222
- "light": "masthead",
222
+ "light": "light:masthead",
223
223
  "text": "When only one masthead light is prescribed for a power-driven vessel, this light shall be exhibited forward of amidships. For a vessel of less than 20 meters in length, the vessel shall exhibit one masthead light as far forward as is practicable."
224
224
  }
225
225
  ],
@@ -272,7 +272,7 @@
272
272
  "vertical_spacing_min_m": 1.5,
273
273
  "small_vessel_relief": {
274
274
  "when": {
275
- "length_m": {
275
+ "fact:length_m": {
276
276
  "lt": 20
277
277
  }
278
278
  },
package/data/images.json CHANGED
@@ -780,7 +780,7 @@
780
780
  "30(d)"
781
781
  ],
782
782
  "entries": [
783
- "30d"
783
+ "30d-red"
784
784
  ]
785
785
  },
786
786
  "NRHB_30_dii.png": {
@@ -810,11 +810,16 @@
810
810
  225,
811
811
  325
812
812
  ],
813
- "source_url": null,
814
- "source": "carried over from mark-brannan/signalk-auto-nav-lights images/; believed USCG, original page not located",
815
- "retrieved": "2026-08-29",
816
- "rights": "unverified - see PROVENANCE.md",
817
- "provenance_status": "unresolved"
813
+ "source_url": "https://www.navcen.uscg.gov/sites/default/files/images/nr_pics/Arcs/mastheadarc.gif",
814
+ "source": "USCG Navigation Center, Navigation Rules Arcs of Visibility (https://www.navcen.uscg.gov/navigation-rules-arcs-of-visibility)",
815
+ "retrieved": "2026-09-05",
816
+ "rights": "US Government work, public domain (17 U.S.C. 105)",
817
+ "captions": [
818
+ "Masthead Light"
819
+ ],
820
+ "paragraphs": [
821
+ "21(a)"
822
+ ]
818
823
  },
819
824
  "portarc.gif": {
820
825
  "file": "portarc.gif",
@@ -824,11 +829,16 @@
824
829
  225,
825
830
  325
826
831
  ],
827
- "source_url": null,
828
- "source": "carried over from mark-brannan/signalk-auto-nav-lights images/; believed USCG, original page not located",
829
- "retrieved": "2026-08-29",
830
- "rights": "unverified - see PROVENANCE.md",
831
- "provenance_status": "unresolved"
832
+ "source_url": "https://www.navcen.uscg.gov/sites/default/files/images/nr_pics/Arcs/portarc.gif",
833
+ "source": "USCG Navigation Center, Navigation Rules Arcs of Visibility (https://www.navcen.uscg.gov/navigation-rules-arcs-of-visibility)",
834
+ "retrieved": "2026-09-05",
835
+ "rights": "US Government work, public domain (17 U.S.C. 105)",
836
+ "captions": [
837
+ "Port SideLight"
838
+ ],
839
+ "paragraphs": [
840
+ "21(b)"
841
+ ]
832
842
  },
833
843
  "stbdarc.gif": {
834
844
  "file": "stbdarc.gif",
@@ -838,11 +848,16 @@
838
848
  225,
839
849
  325
840
850
  ],
841
- "source_url": null,
842
- "source": "carried over from mark-brannan/signalk-auto-nav-lights images/; believed USCG, original page not located",
843
- "retrieved": "2026-08-29",
844
- "rights": "unverified - see PROVENANCE.md",
845
- "provenance_status": "unresolved"
851
+ "source_url": "https://www.navcen.uscg.gov/sites/default/files/images/nr_pics/Arcs/stbdarc.gif",
852
+ "source": "USCG Navigation Center, Navigation Rules Arcs of Visibility (https://www.navcen.uscg.gov/navigation-rules-arcs-of-visibility)",
853
+ "retrieved": "2026-09-05",
854
+ "rights": "US Government work, public domain (17 U.S.C. 105)",
855
+ "captions": [
856
+ "Starboard SideLight"
857
+ ],
858
+ "paragraphs": [
859
+ "21(b)"
860
+ ]
846
861
  },
847
862
  "sternarc.gif": {
848
863
  "file": "sternarc.gif",
@@ -852,11 +867,16 @@
852
867
  225,
853
868
  325
854
869
  ],
855
- "source_url": null,
856
- "source": "carried over from mark-brannan/signalk-auto-nav-lights images/; believed USCG, original page not located",
857
- "retrieved": "2026-08-29",
858
- "rights": "unverified - see PROVENANCE.md",
859
- "provenance_status": "unresolved"
870
+ "source_url": "https://www.navcen.uscg.gov/sites/default/files/images/nr_pics/Arcs/sternarc.gif",
871
+ "source": "USCG Navigation Center, Navigation Rules Arcs of Visibility (https://www.navcen.uscg.gov/navigation-rules-arcs-of-visibility)",
872
+ "retrieved": "2026-09-05",
873
+ "rights": "US Government work, public domain (17 U.S.C. 105)",
874
+ "captions": [
875
+ "Stern Light"
876
+ ],
877
+ "paragraphs": [
878
+ "21(c)"
879
+ ]
860
880
  },
861
881
  "towingarc.gif": {
862
882
  "file": "towingarc.gif",
@@ -866,11 +886,17 @@
866
886
  225,
867
887
  325
868
888
  ],
869
- "source_url": null,
870
- "source": "carried over from mark-brannan/signalk-auto-nav-lights images/; believed USCG, original page not located",
871
- "retrieved": "2026-08-29",
872
- "rights": "unverified - see PROVENANCE.md",
873
- "provenance_status": "unresolved"
889
+ "source_url": "https://www.navcen.uscg.gov/sites/default/files/images/nr_pics/Arcs/towingarc.gif",
890
+ "source": "USCG Navigation Center, Navigation Rules Arcs of Visibility (https://www.navcen.uscg.gov/navigation-rules-arcs-of-visibility)",
891
+ "retrieved": "2026-09-05",
892
+ "rights": "US Government work, public domain (17 U.S.C. 105)",
893
+ "captions": [
894
+ "Towing Light"
895
+ ],
896
+ "paragraphs": [
897
+ "21(d)",
898
+ "24(a)(iv)"
899
+ ]
874
900
  }
875
901
  }
876
902
  }
package/data/lights.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "ruleset": "international",
2
+ "jurisdiction": "intl",
3
3
  "bearing_convention": {
4
4
  "zero": "right ahead",
5
5
  "direction": "clockwise (0 bow, 90 starboard beam, 180 right aft)",
@@ -7,7 +7,7 @@
7
7
  "wrap": "an arc with from_deg > to_deg wraps through 0"
8
8
  },
9
9
  "lights": {
10
- "masthead": {
10
+ "light:masthead": {
11
11
  "name": "masthead light",
12
12
  "colregs_term": "masthead light",
13
13
  "cite": "21(a)",
@@ -21,21 +21,21 @@
21
21
  "placement": "over the fore and aft centerline of the vessel; shows from right ahead to 22.5 degrees abaft the beam on either side",
22
22
  "rule21": true
23
23
  },
24
- "sidelights": {
24
+ "light:sidelights": {
25
25
  "name": "sidelights",
26
26
  "colregs_term": "sidelights",
27
27
  "cite": "21(b)",
28
28
  "character": "steady",
29
29
  "composite": true,
30
30
  "components": [
31
- "sidelight_starboard",
32
- "sidelight_port"
31
+ "light:sidelight_starboard",
32
+ "light:sidelight_port"
33
33
  ],
34
34
  "placement": "one on each side; in a vessel of less than 20 meters in length they may be combined in one lantern carried on the fore and aft centerline",
35
35
  "combined_lantern_max_length_m": 20,
36
36
  "rule21": true
37
37
  },
38
- "sidelight_starboard": {
38
+ "light:sidelight_starboard": {
39
39
  "name": "starboard sidelight",
40
40
  "colregs_term": "sidelight",
41
41
  "cite": "21(b)",
@@ -49,7 +49,7 @@
49
49
  "side": "starboard",
50
50
  "rule21": true
51
51
  },
52
- "sidelight_port": {
52
+ "light:sidelight_port": {
53
53
  "name": "port sidelight",
54
54
  "colregs_term": "sidelight",
55
55
  "cite": "21(b)",
@@ -63,7 +63,7 @@
63
63
  "side": "port",
64
64
  "rule21": true
65
65
  },
66
- "sternlight": {
66
+ "light:sternlight": {
67
67
  "name": "sternlight",
68
68
  "colregs_term": "sternlight",
69
69
  "cite": "21(c)",
@@ -77,7 +77,7 @@
77
77
  "placement": "as nearly as practicable at the stern; shows 67.5 degrees from right aft on each side",
78
78
  "rule21": true
79
79
  },
80
- "towing": {
80
+ "light:towing": {
81
81
  "name": "towing light",
82
82
  "colregs_term": "towing light",
83
83
  "cite": "21(d)",
@@ -88,10 +88,10 @@
88
88
  "from_deg": 112.5,
89
89
  "to_deg": 247.5
90
90
  },
91
- "same_characteristics_as": "sternlight",
91
+ "same_characteristics_as": "light:sternlight",
92
92
  "rule21": true
93
93
  },
94
- "all_round": {
94
+ "light:all_round": {
95
95
  "name": "all-round light",
96
96
  "colregs_term": "all-round light",
97
97
  "cite": "21(e)",
@@ -105,7 +105,7 @@
105
105
  },
106
106
  "rule21": true
107
107
  },
108
- "flashing": {
108
+ "light:flashing": {
109
109
  "name": "flashing light",
110
110
  "colregs_term": "flashing light",
111
111
  "cite": "21(f)",
@@ -121,7 +121,7 @@
121
121
  "note": "Rule 21(f) defines the character only; every International use of it (23(b), 23(c)) is an all-round light.",
122
122
  "rule21": true
123
123
  },
124
- "torch": {
124
+ "light:torch": {
125
125
  "name": "electric torch or lighted lantern",
126
126
  "colregs_term": "electric torch or lighted lantern",
127
127
  "cite": "25(d)(i)",
@@ -132,7 +132,7 @@
132
132
  "rule21": false,
133
133
  "note": "Not a fixed navigation light: it is held ready at hand and shown on approach. It has no prescribed arc, range or position."
134
134
  },
135
- "deck_lights": {
135
+ "light:deck_lights": {
136
136
  "name": "working or equivalent lights",
137
137
  "colregs_term": "working or equivalent lights",
138
138
  "cite": "30(c)",
@@ -151,69 +151,69 @@
151
151
  {
152
152
  "cite": "22(a)",
153
153
  "when": {
154
- "length_m": {
154
+ "fact:length_m": {
155
155
  "gte": 50
156
156
  }
157
157
  },
158
158
  "ranges_nm": {
159
- "masthead": 6,
160
- "sidelight": 3,
161
- "sternlight": 3,
162
- "towing": 3,
163
- "all_round": 3
159
+ "light:masthead": 6,
160
+ "light:sidelights": 3,
161
+ "light:sternlight": 3,
162
+ "light:towing": 3,
163
+ "light:all_round": 3
164
164
  }
165
165
  },
166
166
  {
167
167
  "cite": "22(b)",
168
168
  "when": {
169
- "length_m": {
169
+ "fact:length_m": {
170
170
  "gte": 12,
171
171
  "lt": 50
172
172
  }
173
173
  },
174
174
  "ranges_nm": {
175
- "masthead": 5,
176
- "sidelight": 2,
177
- "sternlight": 2,
178
- "towing": 2,
179
- "all_round": 2
175
+ "light:masthead": 5,
176
+ "light:sidelights": 2,
177
+ "light:sternlight": 2,
178
+ "light:towing": 2,
179
+ "light:all_round": 2
180
180
  }
181
181
  },
182
182
  {
183
183
  "cite": "22(b)(i)",
184
184
  "when": {
185
- "length_m": {
185
+ "fact:length_m": {
186
186
  "gte": 12,
187
187
  "lt": 20
188
188
  }
189
189
  },
190
190
  "refines": "22(b)",
191
191
  "overrides_nm": {
192
- "masthead": 3
192
+ "light:masthead": 3
193
193
  }
194
194
  },
195
195
  {
196
196
  "cite": "22(c)",
197
197
  "when": {
198
- "length_m": {
198
+ "fact:length_m": {
199
199
  "lt": 12
200
200
  }
201
201
  },
202
202
  "ranges_nm": {
203
- "masthead": 2,
204
- "sidelight": 1,
205
- "sternlight": 2,
206
- "towing": 2,
207
- "all_round": 2
203
+ "light:masthead": 2,
204
+ "light:sidelights": 1,
205
+ "light:sternlight": 2,
206
+ "light:towing": 2,
207
+ "light:all_round": 2
208
208
  }
209
209
  },
210
210
  {
211
211
  "cite": "22(d)",
212
212
  "when": {
213
- "inconspicuous_partly_submerged_tow": true
213
+ "fact:inconspicuous_partly_submerged_tow": true
214
214
  },
215
215
  "ranges_nm": {
216
- "all_round": 3
216
+ "light:all_round": 3
217
217
  }
218
218
  }
219
219
  ]