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.
Files changed (44) hide show
  1. package/README.md +13 -11
  2. package/data/applicability.json +478 -503
  3. package/data/facts.json +22 -22
  4. package/data/geometry.json +8 -8
  5. package/data/i18n/en.json +27 -0
  6. package/data/i18n/fi.json +25 -0
  7. package/data/images.json +32 -32
  8. package/data/operations.json +79 -0
  9. package/data/rules.json +5 -0
  10. package/data/version.json +1 -1
  11. package/docs/adr/0006-json-schema-and-identifier-diff.md +2 -0
  12. package/docs/adr/0011-api-shape.md +7 -7
  13. package/docs/adr/0012-trace-and-rule2-departure-api.md +2 -2
  14. package/docs/adr/0014-engine-interface-owned-by-colregs.md +103 -0
  15. package/docs/adr/0015-rule-ids-are-paragraph-keys.md +191 -0
  16. package/docs/adr/0016-encounter-roles-are-pooled-across-frames.md +82 -0
  17. package/docs/adr/0017-closed-vocabularies-are-prefixed-identifiers.md +105 -0
  18. package/docs/budgets.json +8 -15
  19. package/docs/decisions.md +6 -0
  20. package/docs/identifiers.md +121 -109
  21. package/docs/maritime-sources.md +58 -0
  22. package/docs/normative-language.md +103 -0
  23. package/docs/part-b-invariants.md +48 -45
  24. package/docs/requirements.md +147 -138
  25. package/fixtures/applicability-fixtures.json +190 -190
  26. package/fixtures/situation-fixtures.json +870 -599
  27. package/package.json +1 -1
  28. package/schema/applicability-fixtures.schema.json +4 -13
  29. package/schema/applicability.schema.json +77 -77
  30. package/schema/conduct-evaluation.schema.json +135 -0
  31. package/schema/display-evaluation.schema.json +146 -0
  32. package/schema/encounter-evaluation.schema.json +109 -0
  33. package/schema/evaluation.schema.json +149 -0
  34. package/schema/fact-record.schema.json +30 -0
  35. package/schema/facts.schema.json +4 -4
  36. package/schema/i18n-catalog.schema.json +47 -0
  37. package/schema/operations.schema.json +124 -0
  38. package/schema/rule2-departure-finding.schema.json +72 -0
  39. package/schema/rule2-departure-model.schema.json +159 -0
  40. package/schema/situation-fixtures.schema.json +30 -127
  41. package/schema/situation.schema.json +72 -0
  42. package/schema/trace.schema.json +33 -0
  43. package/data/deprecated-identifiers.json +0 -7
  44. package/schema/deprecated-identifiers.schema.json +0 -29
@@ -34,9 +34,9 @@ suffix naming what distinguishes them.
34
34
  - Insertion appends a suffix and never renumbers; a suffix names something and
35
35
  is not an ordinal (`REQ-INV-2`).
36
36
  - The paragraph is the unit (ADR 0001): an invariant reading several takes the
37
- id of the one stating its operative content, as entry `14b` does.
37
+ id of the one stating its operative content, as entry `rule:14b` does.
38
38
  - `INV-` is a type prefix on a citation-derived name — the one departure from
39
- `docs/identifiers.md`, because `13a` is already an entry id. Jurisdiction is a
39
+ `docs/identifiers.md`, because `rule:13a` is already an entry id. Jurisdiction is a
40
40
  dimension (`REQ-SCOPE-2`, `Q-8`); only `intl` is populated.
41
41
 
42
42
  ---
@@ -46,7 +46,7 @@ suffix naming what distinguishes them.
46
46
  A **situation** is the record of `REQ-CAT-4` and `REQ-CAT-6`: two per-vessel
47
47
  fact records, a kinematic state each, relative geometry, history and the
48
48
  environment, addressed as `<subject>:<class>:<key>`, subject in
49
- `own`/`other`/`pair`. A **trace** is a sequence of situations for one ordered
49
+ `self`/`other`/`pair`. A **trace** is a sequence of situations for one ordered
50
50
  pair, sampled at *t*₀ < *t*₁ < … . Each invariant is a property of one state
51
51
  ("at every state") or relates two or more ("at every state after", "from the
52
52
  first state at which") — the whole content of §4.1's `conduct` category, and
@@ -74,18 +74,18 @@ latches the result against the geometry that follows.
74
74
  `13(b)` under 11 · classification · single-state · `✎`
75
75
 
76
76
  **Invariant.** At any state at which the two vessels are in sight of one
77
- another and both underway, own is deemed to be overtaking other exactly when
78
- own is coming up with other and own bears, from other, more than 22.5° abaft
77
+ another and both underway, self is deemed to be overtaking other exactly when
78
+ self is coming up with other and self bears, from other, more than 22.5° abaft
79
79
  other's beam — `other:geo:rel_bearing_deg` strictly inside (112.5°, 247.5°).
80
80
  The sector is open at both ends (*more than* 22.5°: a vessel on the edge is
81
81
  not overtaking); its edges are the forward edges of Rule 21(c)'s sternlight
82
82
  arc, which 13(b)'s second limb states in light terms.
83
83
 
84
84
  - **Undetermined term.** "Coming up with" is a speed comparison the model cannot
85
- express (`Q-46`); `13b-overtaking` substitutes `pair:geo:tcpa_s > 0`, which
85
+ express (`Q-46`); `rule:13b` substitutes `pair:geo:tcpa_s > 0`, which
86
86
  admits a pair closing because the vessel ahead stopped. This states the rule.
87
87
  - **Not stated by 13(b).** Risk of collision: `Q-50`.
88
- - Entries: `13b-overtaking`, `13b-overtaken`;
88
+ - Entries: `rule:13b`;
89
89
  `situation.constants.overtaking_sector_from_deg`/`_to_deg` (ink). Settled by
90
90
  P2.2's Alloy sector model: a partition, or a bearing that falls in both.
91
91
 
@@ -93,16 +93,18 @@ arc, which 13(b)'s second limb states in light terms.
93
93
 
94
94
  `13(b)` · classification, derived · single-state · `✎`
95
95
 
96
- **Invariant.** Where `INV-13b` holds of own with respect to other, the
96
+ **Invariant.** Where `INV-13b` holds of self with respect to other, the
97
97
  encounter type of the pair is `overtaking` read from *either* subject: the
98
98
  vessel being overtaken is in an overtaking, not a crossing, though the
99
99
  overtaking vessel bears forward of her beam.
100
100
 
101
101
  - **Why separate.** A formalisation carrying encounter type per vessel
102
102
  classifies the overtaken side as a crossing, two types on one pair.
103
- - Entries: `13b-overtaking`, `13b-overtaken`, each other's `when` with subjects
104
- swapped. Settled by P4.2 carrying the type on the pair and TLC finding no
105
- state where the subjects disagree.
103
+ - **2026-09-16.** The two-entry form this section recorded is reversed by
104
+ ADR 0015 as rewritten: 13(b) is one symmetric entry, the same sector object
105
+ read on either subject under `any_of`. The invariant is unchanged.
106
+ - Entries: `rule:13b`. Settled by P4.2 carrying the type on the pair and TLC
107
+ finding no state where the subjects disagree.
106
108
 
107
109
  ### INV-13a — the overtaking vessel keeps out of the way
108
110
 
@@ -116,7 +118,7 @@ roles displace any role Rules 4–18 would otherwise assign to either vessel.
116
118
  well as Rules 14 and 15.
117
119
 
118
120
  - **Not stated by 13(a).** Risk of collision: `Q-50`.
119
- - Entries: `13a`, overriding all eleven Rule 18 and all three Rule 12 entries.
121
+ - Entries: `rule:13a`, overriding all eleven Rule 18 and all three Rule 12 entries.
120
122
  Settled by P4.2's role assignment: the override is or is not needed to keep
121
123
  "never both give-way" true.
122
124
 
@@ -125,13 +127,13 @@ well as Rules 14 and 15.
125
127
  `13(d)` · classification · temporal, a state to every later state of the
126
128
  encounter · `✎`
127
129
 
128
- **Invariant.** Let *s* be the first state of an encounter at which own is
130
+ **Invariant.** Let *s* be the first state of an encounter at which self is
129
131
  deemed to be overtaking other. At every state of that encounter after *s*,
130
- until own is finally past and clear, the encounter type of the pair is
132
+ until self is finally past and clear, the encounter type of the pair is
131
133
  `overtaking` whatever the relative bearings then are; in particular it is not
132
134
  `crossing`, and the tests of Rules 14 and 15 do not apply to the pair.
133
135
 
134
- - **State remembered.** One directional boolean per subject per encounter (own
136
+ - **State remembered.** One directional boolean per subject per encounter (self
135
137
  was, earlier in this encounter, the overtaking vessel), plus the time of *s*
136
138
  for a monitor that says when the duty attached; window *s* to finally past and
137
139
  clear. Reading only the current state is wrong in the direction the paragraph
@@ -142,8 +144,8 @@ until own is finally past and clear, the encounter type of the pair is
142
144
  model's is its segmentation, and no bearing or range is invented here.
143
145
  - **Readings in doubt.** Two: what arms the latch, `Q-51`; what it forbids,
144
146
  `Q-52`.
145
- - Entries: `13d`, reading `own`/`other:hist:was_overtaking` and no geometry; the
146
- `was_overtaking: false` gates on `14b`, `15a-crossing`, `15a-give-way`
147
+ - Entries: `rule:13d`, reading `self`/`other:hist:was_overtaking` and no geometry; the
148
+ `was_overtaking: false` gates on `rule:14b`, `rule:15a:crossing`, `rule:15a:keep_out_of_the_way`
147
149
  implement `Q-52`'s *broad* reading. Settled by `Q-51`, `Q-52`, then TLC on a
148
150
  three-state trace of an overtaking drawing out onto the bow.
149
151
 
@@ -151,15 +153,15 @@ until own is finally past and clear, the encounter type of the pair is
151
153
 
152
154
  `13(d)` second limb · precedence · temporal, as `INV-13d` · `✎`
153
155
 
154
- **Invariant.** With *s* as in `INV-13d`, at every state after *s* until own is
155
- finally past and clear, own holds `give-way` and other `stand-on`, whatever the
156
+ **Invariant.** With *s* as in `INV-13d`, at every state after *s* until self is
157
+ finally past and clear, self holds `give-way` and other `stand-on`, whatever the
156
158
  bearings. Separate from `INV-13d` because the two limbs come apart: a reading
157
159
  on which 13(d) forbids only the *crossing* reclassification still preserves
158
160
  the duty by its second clause, and a formalisation deriving role from encounter
159
161
  type alone cannot distinguish `Q-52`'s readings.
160
162
 
161
163
  - **State remembered.** As `INV-13d`.
162
- - Entries: `13a`'s `any_of` second limb, `own:hist:was_overtaking: true` — role
164
+ - Entries: `rule:13a`'s `any_of` second limb, `self:hist:was_overtaking: true` — role
163
165
  asserted from the latch directly, keeping the limbs separable. Settled by
164
166
  `Q-52`.
165
167
 
@@ -174,7 +176,7 @@ type alone cannot distinguish `Q-52`'s readings.
174
176
  **Invariant.** At any state at which two power-driven vessels are in sight,
175
177
  both underway, with risk of collision, and neither latched under `INV-13d`, a
176
178
  head-on situation is deemed to exist exactly when each sees the other ahead or
177
- nearly ahead: `own:geo:rel_bearing_deg` and `other:geo:rel_bearing_deg` each
179
+ nearly ahead: `self:geo:rel_bearing_deg` and `other:geo:rel_bearing_deg` each
178
180
  in [0°, 11.25°] ∪ [348.75°, 360°).
179
181
 
180
182
  - **Both bearings, not one.** 14(b)'s lights limb is a statement about the
@@ -186,7 +188,7 @@ in [0°, 11.25°] ∪ [348.75°, 360°).
186
188
  that way.
187
189
  - **Not formalised.** The night and day observation limbs are stated as the
188
190
  geometry they encode; a vessel that cannot see the lights has 14(c).
189
- - Entries: `14b`. Settled by `INV-13b`'s partition sweep plus a decision on the
191
+ - Entries: `rule:14b`. Settled by `INV-13b`'s partition sweep plus a decision on the
190
192
  constant.
191
193
 
192
194
  ### INV-14a — both vessels alter to starboard
@@ -205,8 +207,8 @@ way; both are directed to act, and the duty is symmetric.
205
207
  - **Why it matters formally.** The one Section II encounter with no `stand-on`
206
208
  vessel, and why `INV-17a1-scope` has content.
207
209
  - Entries: none; `conduct`, in `known_omissions`, no conduct shape (`Q-45`);
208
- `14a` is retired in `data/deprecated-identifiers.json`. Settled by the first
209
- conduct monitor.
210
+ `14a` was never a name and is gone with the rest of the citation-derived ids
211
+ (ADR 0015). Settled by the first conduct monitor.
210
212
 
211
213
  ---
212
214
 
@@ -228,7 +230,7 @@ encounter type is `crossing` exactly when it is neither `overtaking` under
228
230
  - **Known incompleteness.** Two sailing vessels get no encounter type (Rules 14
229
231
  and 15 are gated on power, Rule 12 has no deeming paragraph): the Rules'. A
230
232
  pair with the history fact absent gets none: the model's (`Q-43`).
231
- - Entries: `15a-crossing`.
233
+ - Entries: `rule:15a:crossing`.
232
234
 
233
235
  ### INV-15a-give-way — the vessel with the other to starboard gives way
234
236
 
@@ -239,9 +241,9 @@ vessel which has the other on her own starboard side holds `give-way` and the
239
241
  other holds `stand-on`.
240
242
 
241
243
  - **Undetermined term.** "On her own starboard side" has no sector in the
242
- paragraph; the data reads `own:geo:rel_bearing_deg` in (0°, 112.5°], its upper
244
+ paragraph; the data reads `self:geo:rel_bearing_deg` in (0°, 112.5°], its upper
243
245
  edge 13(b)'s constant, so it is checkable against the partition.
244
- - Entries: `15a-give-way`, plus six `rel:overrides` from Rule 18 entries, since
246
+ - Entries: `rule:15a:keep_out_of_the_way`, plus six `rel:overrides` from Rule 18 entries, since
245
247
  Rule 18's chapeau excepts Rules 9, 10 and 13 and no others.
246
248
 
247
249
  ### INV-15a-single — at most one give-way vessel in a crossing
@@ -253,7 +255,7 @@ bearings only
253
255
  under `INV-15a-give-way`.
254
256
 
255
257
  - **Why it is not free.** Both-starboard is a consistent *record* and an
256
- impossible *situation* on a steady bearing: own's speed times the sine of her
258
+ impossible *situation* on a steady bearing: self's speed times the sine of her
257
259
  relative bearing equals minus other's speed times the sine of the aspect, so
258
260
  the bearings lie on opposite sides. A theorem at zero bearing rate, an
259
261
  observation elsewhere.
@@ -277,7 +279,7 @@ advancing position.
277
279
  segment ("ahead of" a moving vessel), and the state the role attached.
278
280
  - **Undetermined term.** "If the circumstances of the case admit" has nowhere to
279
281
  live — `modality` is one closed value, an action has no `effect` — `Q-31`.
280
- - Entries: none; a `gap` on `15a-give-way`.
282
+ - Entries: none; a `gap` on `rule:15a:keep_out_of_the_way`.
281
283
 
282
284
  ---
283
285
 
@@ -443,7 +445,7 @@ discharge her obligation.
443
445
  - **Why separate.** The natural automaton takes the give-way duty as an input to
444
446
  its transitions; 17(d) says the arrow does not run back, so model two
445
447
  obligations holding concurrently, not one machine with one obligation.
446
- - Entries: none; nearest is 8(f)(ii)'s parallel for `shall-not-impede`, `8f3`.
448
+ - Entries: none; nearest is 8(f)(ii)'s parallel for `shall-not-impede`, `rule:8f_iii`.
447
449
 
448
450
  ### INV-17-phases — the phase structure
449
451
 
@@ -485,9 +487,9 @@ governs.
485
487
  - **Why both directions.** "To nothing else" is what runs the `rel:overrides`
486
488
  edges from Rule 18 *to* Rules 12 and 15; got wrong once, found by a sweep
487
489
  (`Q-40`).
488
- - Entries: overrides on `13a` against all Rule 18 and Rule 12 entries; on
489
- `18a1`–`18a3`, `18c1`–`18c2`, `18f1` against `15a-give-way`; on the Rule 18
490
- entries that can meet two sailing vessels against `12a1`–`12a3`; a derived
490
+ - Entries: overrides on `rule:13a` against all Rule 18 and Rule 12 entries; on
491
+ the 18(a)(i)–(iii) entries, the two 18(c) entries, `rule:18f_i` against `rule:15a:keep_out_of_the_way`; on the Rule 18
492
+ entries that can meet two sailing vessels against the three Rule 12 entries; a derived
491
493
  check asserts the hand-list of six against Rule 15 is complete.
492
494
 
493
495
  ### INV-18-order — the rank order
@@ -510,7 +512,7 @@ The subject holds `give-way`; the object `stand-on`.
510
512
  (`Q-32`) is the model's decode onto these ranks. A vessel constrained by her
511
513
  draught is a power-driven vessel for 18(a) and is ranked by it.
512
514
  - **Not stated by Rule 18.** Risk of collision and encounter type: `Q-50`.
513
- - Entries: `18a1`–`18a4`, `18b1`–`18b3`, `18c1`–`18c2`.
515
+ - Entries: the four 18(a) entries, the three 18(b) entries, the two 18(c) entries.
514
516
 
515
517
  ### INV-18-partial — the order is partial, and the gaps are the Rules'
516
518
 
@@ -542,7 +544,7 @@ discharging `INV-16` requires of her.
542
544
 
543
545
  - **Why stated.** Read as a condition on the antecedent, it gives a roleless
544
546
  pair exactly when compliance is hard and the roles matter.
545
- - Entries: `18c1`, `18c2`, modality `shall-if-practicable` with effect
547
+ - Entries: `rule:18c_i`, `rule:18c_ii`, modality `shall-if-practicable` with effect
546
548
  `give-way`/`stand-on` — `Q-31`'s shape, resolved only because the duty is a
547
549
  role.
548
550
 
@@ -563,8 +565,8 @@ is not relieved (8(f)(ii)).
563
565
  protected vessel a Rule 17 duty no paragraph confers — 8(f)(iii)'s content,
564
566
  and why `none` is explicit.
565
567
  - **Undetermined term.** "Exhibiting the signals in Rule 28" is a
566
- display-compliance fact `18d1` does not read; the entry is wider (`Q-34`).
567
- - Entries: `18d1`, `8f3`.
568
+ display-compliance fact `rule:18d_i` does not read; the entry is wider (`Q-34`).
569
+ - Entries: `rule:18d_i`, `rule:8f_iii`.
568
570
 
569
571
  ### INV-18f1 — the WIG craft keeps well clear
570
572
 
@@ -575,7 +577,7 @@ in flight near the surface, she holds `keep-clear` with respect to every other
575
577
  vessel — keeps well clear and avoids impeding their navigation — and the other
576
578
  holds `none`. `keep-clear` is outside the give-way/stand-on pairing and Rule 16.
577
579
 
578
- - Entries: `18f1`.
580
+ - Entries: `rule:18f_i`.
579
581
 
580
582
  ---
581
583
 
@@ -601,9 +603,9 @@ not jointly exhaustive (`INV-19a-third-state`); Rule 19 supplements Section I
601
603
  cross it and back inside one encounter, and no paragraph says what becomes of
602
604
  a 13(d) latch or a Rule 17 phase: `Q-55`.
603
605
  - **Undetermined term.** "In or near an area of restricted visibility" has no
604
- fact (3(l)'s atmospheric condition is nowhere in `data/facts.json`), so `19a`
606
+ fact (3(l)'s atmospheric condition is nowhere in `data/facts.json`), so `rule:19a`
605
607
  selects Section III for any pair not in sight — wider — and records a gap.
606
- - Entries: `11`, `19a`, complementary on `pair:geo:in_sight`.
608
+ - Entries: `rule:11`, `rule:19a`, complementary on `pair:geo:in_sight`.
607
609
 
608
610
  ### INV-19a-noroles — Section III has no give-way and no stand-on vessel
609
611
 
@@ -633,7 +635,7 @@ excludes Section II, 19(a) excludes Rule 19, and only Section I governs.
633
635
  - **Why written down.** A hole forced by both scope paragraphs, which "not
634
636
  Section II, so Section III" will not have. The model closes it by dropping
635
637
  19(a)'s second conjunct — a decision, not a reading: `Q-56`.
636
- - Entries: `19a`'s `gap`.
638
+ - Entries: `rule:19a`'s `gap`.
637
639
 
638
640
  ### INV-19b — safe speed, and engines ready
639
641
 
@@ -701,7 +703,7 @@ action in ample time.
701
703
 
702
704
  **Invariant.** Where `INV-19d-action`'s action is an alteration of course,
703
705
  then so far as possible the vessel shall not alter course to port for a vessel
704
- forward of her beam — `own:geo:rel_bearing_deg` in (270°, 360°) ∪ [0°, 90°) —
706
+ forward of her beam — `self:geo:rel_bearing_deg` in (270°, 360°) ∪ [0°, 90°) —
705
707
  other than for a vessel being overtaken.
706
708
 
707
709
  - **The exception reaches across the switch.** "A vessel being overtaken" is
@@ -716,7 +718,7 @@ other than for a vessel being overtaken.
716
718
 
717
719
  **Invariant.** Where `INV-19d-action`'s action is an alteration of course,
718
720
  then so far as possible the vessel shall not alter course toward a vessel
719
- abeam or abaft her beam — `own:geo:rel_bearing_deg` in [90°, 270°].
721
+ abeam or abaft her beam — `self:geo:rel_bearing_deg` in [90°, 270°].
720
722
 
721
723
  - **"Toward"** is the sign of the alteration against the other's bearing, not
722
724
  the resulting heading: toward when it reduces her relative bearing off the bow
@@ -758,7 +760,7 @@ paragraph of its own.
758
760
 
759
761
  `13(a)`, `15(a)`, `12(a)`, `18(a)–(c)` with 18's chapeau · precedence, derived
760
762
  · single-state · `✎`, asserted over consistent steady bearings only
761
- (`REQ-VERIFY-8`)
763
+ (`REQ-VERIFY-8`), over the pooled two-frame read of ADR 0016
762
764
 
763
765
  **Invariant.** At every state, after every `rel:overrides` is applied, no pair
764
766
  holds `give-way` on both subjects, and none holds `stand-on` on both.
@@ -784,7 +786,8 @@ P2.2.
784
786
 
785
787
  ### INV-PB-one-role-source — a vessel holds one helm role at a time
786
788
 
787
- `13(a)`, `18` chapeau, with 16 and 17 · precedence, derived · single-state · `✎`
789
+ `13(a)`, `18` chapeau, with 16 and 17 · precedence, derived · single-state · `✎`,
790
+ over the pooled two-frame read of ADR 0016
788
791
 
789
792
  **Invariant.** After every `rel:overrides` is applied, no vessel holds both
790
793
  `give-way` and `stand-on` with respect to the same other vessel at the same