colregs 0.1.0 → 0.1.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/PROVENANCE.md +1 -1
- package/README.md +130 -19
- package/data/applicability.json +62 -51
- package/data/facts.json +7 -1
- package/data/geometry.json +1 -1
- package/data/images.json +1 -1
- package/data/lights.json +1 -1
- package/data/rules.json +100 -101
- package/docs/adr/0001-name-and-jurisdiction-model.md +76 -0
- package/docs/adr/0002-wig-gate-and-jurisdiction-field.md +77 -0
- package/docs/requirements.md +221 -0
- package/fixtures/applicability-fixtures.json +337 -4
- package/package.json +13 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"note": "Fact records and the applicability entry ids that apply to each, under the International rules at night. An implementation in any language that consumes data/applicability.json should reproduce these exactly, using the predicate semantics in README.md.",
|
|
3
|
-
"
|
|
3
|
+
"jurisdiction": "intl",
|
|
4
4
|
"cases": [
|
|
5
5
|
{
|
|
6
6
|
"name": "sailing yacht 11.6 m under sail",
|
|
@@ -174,18 +174,21 @@
|
|
|
174
174
|
"length_m": 15
|
|
175
175
|
},
|
|
176
176
|
"expect": [
|
|
177
|
-
"30d"
|
|
177
|
+
"30d-anchor",
|
|
178
|
+
"30d-red"
|
|
178
179
|
]
|
|
179
180
|
},
|
|
180
181
|
{
|
|
181
|
-
"name": "aground, 10 m (30(f) relief)",
|
|
182
|
+
"name": "aground, 10 m (30(f) relief from the red lights only, not the anchor lights)",
|
|
182
183
|
"facts": {
|
|
183
184
|
"propulsion": "power",
|
|
184
185
|
"activity": "none",
|
|
185
186
|
"position": "aground",
|
|
186
187
|
"length_m": 10
|
|
187
188
|
},
|
|
188
|
-
"expect": [
|
|
189
|
+
"expect": [
|
|
190
|
+
"30d-anchor"
|
|
191
|
+
]
|
|
189
192
|
},
|
|
190
193
|
{
|
|
191
194
|
"name": "trawler 30 m making way",
|
|
@@ -407,6 +410,336 @@
|
|
|
407
410
|
"23a34",
|
|
408
411
|
"23b"
|
|
409
412
|
]
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"name": "23d1 boundary: 11.9 m power vessel underway",
|
|
416
|
+
"facts": {
|
|
417
|
+
"propulsion": "power",
|
|
418
|
+
"activity": "none",
|
|
419
|
+
"position": "underway",
|
|
420
|
+
"length_m": 11.9
|
|
421
|
+
},
|
|
422
|
+
"expect": [
|
|
423
|
+
"23a1",
|
|
424
|
+
"23a2",
|
|
425
|
+
"23a34",
|
|
426
|
+
"23d1"
|
|
427
|
+
]
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"name": "23d1 boundary: 12.0 m power vessel underway",
|
|
431
|
+
"facts": {
|
|
432
|
+
"propulsion": "power",
|
|
433
|
+
"activity": "none",
|
|
434
|
+
"position": "underway",
|
|
435
|
+
"length_m": 12.0
|
|
436
|
+
},
|
|
437
|
+
"expect": [
|
|
438
|
+
"23a1",
|
|
439
|
+
"23a2",
|
|
440
|
+
"23a34"
|
|
441
|
+
]
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
"name": "23d2 length boundary: 6.9 m power vessel, max speed 7 kn",
|
|
445
|
+
"facts": {
|
|
446
|
+
"propulsion": "power",
|
|
447
|
+
"activity": "none",
|
|
448
|
+
"position": "underway",
|
|
449
|
+
"length_m": 6.9,
|
|
450
|
+
"max_speed_kn": 7
|
|
451
|
+
},
|
|
452
|
+
"expect": [
|
|
453
|
+
"23a1",
|
|
454
|
+
"23a2",
|
|
455
|
+
"23a34",
|
|
456
|
+
"23d1",
|
|
457
|
+
"23d2"
|
|
458
|
+
]
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
"name": "23d2 length boundary: 7.0 m power vessel, max speed 7 kn",
|
|
462
|
+
"facts": {
|
|
463
|
+
"propulsion": "power",
|
|
464
|
+
"activity": "none",
|
|
465
|
+
"position": "underway",
|
|
466
|
+
"length_m": 7.0,
|
|
467
|
+
"max_speed_kn": 7
|
|
468
|
+
},
|
|
469
|
+
"expect": [
|
|
470
|
+
"23a1",
|
|
471
|
+
"23a2",
|
|
472
|
+
"23a34",
|
|
473
|
+
"23d1"
|
|
474
|
+
]
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"name": "23d2 speed boundary: 6.9 m power vessel, max speed 7.0 kn",
|
|
478
|
+
"facts": {
|
|
479
|
+
"propulsion": "power",
|
|
480
|
+
"activity": "none",
|
|
481
|
+
"position": "underway",
|
|
482
|
+
"length_m": 6.9,
|
|
483
|
+
"max_speed_kn": 7.0
|
|
484
|
+
},
|
|
485
|
+
"expect": [
|
|
486
|
+
"23a1",
|
|
487
|
+
"23a2",
|
|
488
|
+
"23a34",
|
|
489
|
+
"23d1",
|
|
490
|
+
"23d2"
|
|
491
|
+
]
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"name": "23d2 speed boundary: 6.9 m power vessel, max speed 7.1 kn",
|
|
495
|
+
"facts": {
|
|
496
|
+
"propulsion": "power",
|
|
497
|
+
"activity": "none",
|
|
498
|
+
"position": "underway",
|
|
499
|
+
"length_m": 6.9,
|
|
500
|
+
"max_speed_kn": 7.1
|
|
501
|
+
},
|
|
502
|
+
"expect": [
|
|
503
|
+
"23a1",
|
|
504
|
+
"23a2",
|
|
505
|
+
"23a34",
|
|
506
|
+
"23d1"
|
|
507
|
+
]
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"name": "25b boundary: 19.9 m sailing vessel underway",
|
|
511
|
+
"facts": {
|
|
512
|
+
"propulsion": "sail",
|
|
513
|
+
"activity": "none",
|
|
514
|
+
"position": "underway",
|
|
515
|
+
"length_m": 19.9
|
|
516
|
+
},
|
|
517
|
+
"expect": [
|
|
518
|
+
"25a",
|
|
519
|
+
"25b",
|
|
520
|
+
"25c"
|
|
521
|
+
]
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
"name": "25b boundary: 20.0 m sailing vessel underway",
|
|
525
|
+
"facts": {
|
|
526
|
+
"propulsion": "sail",
|
|
527
|
+
"activity": "none",
|
|
528
|
+
"position": "underway",
|
|
529
|
+
"length_m": 20.0
|
|
530
|
+
},
|
|
531
|
+
"expect": [
|
|
532
|
+
"25a",
|
|
533
|
+
"25c"
|
|
534
|
+
]
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
"name": "25d1 boundary: 6.9 m sailing vessel underway",
|
|
538
|
+
"facts": {
|
|
539
|
+
"propulsion": "sail",
|
|
540
|
+
"activity": "none",
|
|
541
|
+
"position": "underway",
|
|
542
|
+
"length_m": 6.9
|
|
543
|
+
},
|
|
544
|
+
"expect": [
|
|
545
|
+
"25a",
|
|
546
|
+
"25b",
|
|
547
|
+
"25c",
|
|
548
|
+
"25d1"
|
|
549
|
+
]
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
"name": "25d1 boundary: 7.0 m sailing vessel underway",
|
|
553
|
+
"facts": {
|
|
554
|
+
"propulsion": "sail",
|
|
555
|
+
"activity": "none",
|
|
556
|
+
"position": "underway",
|
|
557
|
+
"length_m": 7.0
|
|
558
|
+
},
|
|
559
|
+
"expect": [
|
|
560
|
+
"25a",
|
|
561
|
+
"25b",
|
|
562
|
+
"25c"
|
|
563
|
+
]
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
"name": "30b boundary: anchored, 49.9 m",
|
|
567
|
+
"facts": {
|
|
568
|
+
"position": "anchored",
|
|
569
|
+
"length_m": 49.9
|
|
570
|
+
},
|
|
571
|
+
"expect": [
|
|
572
|
+
"30a",
|
|
573
|
+
"30b",
|
|
574
|
+
"30c"
|
|
575
|
+
]
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
"name": "30b boundary: anchored, 50.0 m",
|
|
579
|
+
"facts": {
|
|
580
|
+
"position": "anchored",
|
|
581
|
+
"length_m": 50.0
|
|
582
|
+
},
|
|
583
|
+
"expect": [
|
|
584
|
+
"30a",
|
|
585
|
+
"30c"
|
|
586
|
+
]
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
"name": "30d boundary: aground, 11.9 m",
|
|
590
|
+
"facts": {
|
|
591
|
+
"position": "aground",
|
|
592
|
+
"length_m": 11.9
|
|
593
|
+
},
|
|
594
|
+
"expect": [
|
|
595
|
+
"30d-anchor"
|
|
596
|
+
]
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"name": "30d boundary: aground, 12.0 m",
|
|
600
|
+
"facts": {
|
|
601
|
+
"position": "aground",
|
|
602
|
+
"length_m": 12.0
|
|
603
|
+
},
|
|
604
|
+
"expect": [
|
|
605
|
+
"30d-anchor",
|
|
606
|
+
"30d-red"
|
|
607
|
+
]
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"name": "30e boundary: anchored, clear of channel, 6.9 m",
|
|
611
|
+
"facts": {
|
|
612
|
+
"position": "anchored",
|
|
613
|
+
"near_channel": false,
|
|
614
|
+
"length_m": 6.9
|
|
615
|
+
},
|
|
616
|
+
"expect": [
|
|
617
|
+
"30a",
|
|
618
|
+
"30b",
|
|
619
|
+
"30c",
|
|
620
|
+
"30e"
|
|
621
|
+
]
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"name": "30e boundary: anchored, clear of channel, 7.0 m",
|
|
625
|
+
"facts": {
|
|
626
|
+
"position": "anchored",
|
|
627
|
+
"near_channel": false,
|
|
628
|
+
"length_m": 7.0
|
|
629
|
+
},
|
|
630
|
+
"expect": [
|
|
631
|
+
"30a",
|
|
632
|
+
"30b",
|
|
633
|
+
"30c"
|
|
634
|
+
]
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
"name": "24a tow-length boundary: towing 200.0 m",
|
|
638
|
+
"facts": {
|
|
639
|
+
"propulsion": "power",
|
|
640
|
+
"activity": "towing",
|
|
641
|
+
"position": "underway",
|
|
642
|
+
"length_m": 20,
|
|
643
|
+
"tow_length_m": 200.0
|
|
644
|
+
},
|
|
645
|
+
"expect": [
|
|
646
|
+
"24a-m2",
|
|
647
|
+
"24a-rest"
|
|
648
|
+
]
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
"name": "24a tow-length boundary: towing 200.1 m",
|
|
652
|
+
"facts": {
|
|
653
|
+
"propulsion": "power",
|
|
654
|
+
"activity": "towing",
|
|
655
|
+
"position": "underway",
|
|
656
|
+
"length_m": 20,
|
|
657
|
+
"tow_length_m": 200.1
|
|
658
|
+
},
|
|
659
|
+
"expect": [
|
|
660
|
+
"24a-m3",
|
|
661
|
+
"24a-rest"
|
|
662
|
+
]
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
"name": "26c-gear boundary: fishing, gear extent 150.0 m",
|
|
666
|
+
"facts": {
|
|
667
|
+
"activity": "fishing",
|
|
668
|
+
"position": "underway",
|
|
669
|
+
"gear_extent_m": 150.0
|
|
670
|
+
},
|
|
671
|
+
"expect": [
|
|
672
|
+
"26c-id"
|
|
673
|
+
]
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
"name": "26c-gear boundary: fishing, gear extent 150.1 m",
|
|
677
|
+
"facts": {
|
|
678
|
+
"activity": "fishing",
|
|
679
|
+
"position": "underway",
|
|
680
|
+
"gear_extent_m": 150.1
|
|
681
|
+
},
|
|
682
|
+
"expect": [
|
|
683
|
+
"26c-gear",
|
|
684
|
+
"26c-id"
|
|
685
|
+
]
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
"name": "wing-in-ground craft near the surface, 25 m",
|
|
689
|
+
"facts": {
|
|
690
|
+
"propulsion": "power",
|
|
691
|
+
"activity": "none",
|
|
692
|
+
"position": "underway",
|
|
693
|
+
"wig": true,
|
|
694
|
+
"wig_near_surface": true,
|
|
695
|
+
"length_m": 25
|
|
696
|
+
},
|
|
697
|
+
"expect": [
|
|
698
|
+
"23a1",
|
|
699
|
+
"23a2",
|
|
700
|
+
"23a34",
|
|
701
|
+
"23c"
|
|
702
|
+
]
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
"name": "wing-in-ground craft cruising, not near the surface, 25 m",
|
|
706
|
+
"facts": {
|
|
707
|
+
"propulsion": "power",
|
|
708
|
+
"activity": "none",
|
|
709
|
+
"position": "underway",
|
|
710
|
+
"wig": true,
|
|
711
|
+
"wig_near_surface": false,
|
|
712
|
+
"length_m": 25
|
|
713
|
+
},
|
|
714
|
+
"expect": [
|
|
715
|
+
"23a1",
|
|
716
|
+
"23a2",
|
|
717
|
+
"23a34"
|
|
718
|
+
]
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
"name": "vessel or object being towed astern",
|
|
722
|
+
"facts": {
|
|
723
|
+
"activity": "being_towed",
|
|
724
|
+
"position": "underway",
|
|
725
|
+
"length_m": 15
|
|
726
|
+
},
|
|
727
|
+
"expect": [
|
|
728
|
+
"24e"
|
|
729
|
+
]
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
"name": "fishing other than trawling, making way",
|
|
733
|
+
"facts": {
|
|
734
|
+
"activity": "fishing",
|
|
735
|
+
"position": "underway",
|
|
736
|
+
"making_way": true,
|
|
737
|
+
"length_m": 12
|
|
738
|
+
},
|
|
739
|
+
"expect": [
|
|
740
|
+
"26c-id",
|
|
741
|
+
"26c-mw"
|
|
742
|
+
]
|
|
410
743
|
}
|
|
411
744
|
]
|
|
412
745
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "colregs",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "COLREGS 72
|
|
3
|
+
"version": "0.1.1",
|
|
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": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/mark-brannan/colregs.git"
|
|
9
9
|
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"colregs",
|
|
12
|
+
"navrules",
|
|
13
|
+
"navigation-rules",
|
|
14
|
+
"inland-rules",
|
|
15
|
+
"33-cfr-83",
|
|
16
|
+
"cevni",
|
|
17
|
+
"collision-regulations",
|
|
18
|
+
"navigation-lights"
|
|
19
|
+
],
|
|
10
20
|
"scripts": { "test": "node --test test/*.mjs" },
|
|
11
|
-
"files": ["data", "images", "fixtures", "PROVENANCE.md"]
|
|
21
|
+
"files": ["data", "images", "fixtures", "docs", "PROVENANCE.md"]
|
|
12
22
|
}
|