colregs 0.2.2 → 0.2.3
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
CHANGED
|
@@ -347,7 +347,7 @@ came out right.
|
|
|
347
347
|
From 0.2.0 on, every identifier in the package is immutable once published
|
|
348
348
|
(REQ-MODEL-10). [`data/deprecated-identifiers.json`](data/deprecated-identifiers.json)
|
|
349
349
|
is the REQ-MODEL-11 registry a retired identifier goes into, and `npm test`
|
|
350
|
-
refuses a removal that is not recorded there.
|
|
350
|
+
refuses a removal that is not recorded there. [`data/version.json`](data/version.json) mirrors `package.json`; release-please keeps it in sync (see [ADR 0009](docs/adr/0009-data-version-stamp.md)).
|
|
351
351
|
|
|
352
352
|
## Provenance and licence
|
|
353
353
|
|
package/data/applicability.json
CHANGED
|
@@ -410,8 +410,15 @@
|
|
|
410
410
|
"count": 1
|
|
411
411
|
}
|
|
412
412
|
],
|
|
413
|
-
"rel:
|
|
414
|
-
|
|
413
|
+
"rel:conditional_includes": [
|
|
414
|
+
{
|
|
415
|
+
"when": {
|
|
416
|
+
"fact:position": "position:underway"
|
|
417
|
+
},
|
|
418
|
+
"rel:includes": [
|
|
419
|
+
"23a34"
|
|
420
|
+
]
|
|
421
|
+
}
|
|
415
422
|
],
|
|
416
423
|
"modality": "shall",
|
|
417
424
|
"images": [
|
|
@@ -427,10 +434,17 @@
|
|
|
427
434
|
"fact:composite_unit": true
|
|
428
435
|
},
|
|
429
436
|
"lights": [],
|
|
430
|
-
"rel:
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
437
|
+
"rel:conditional_includes": [
|
|
438
|
+
{
|
|
439
|
+
"when": {
|
|
440
|
+
"fact:position": "position:underway"
|
|
441
|
+
},
|
|
442
|
+
"rel:includes": [
|
|
443
|
+
"23a1",
|
|
444
|
+
"23a2",
|
|
445
|
+
"23a34"
|
|
446
|
+
]
|
|
447
|
+
}
|
|
434
448
|
],
|
|
435
449
|
"modality": "shall",
|
|
436
450
|
"images": [
|
|
@@ -453,8 +467,15 @@
|
|
|
453
467
|
"arrangement": "vertical"
|
|
454
468
|
}
|
|
455
469
|
],
|
|
456
|
-
"rel:
|
|
457
|
-
|
|
470
|
+
"rel:conditional_includes": [
|
|
471
|
+
{
|
|
472
|
+
"when": {
|
|
473
|
+
"fact:position": "position:underway"
|
|
474
|
+
},
|
|
475
|
+
"rel:includes": [
|
|
476
|
+
"23a34"
|
|
477
|
+
]
|
|
478
|
+
}
|
|
458
479
|
],
|
|
459
480
|
"rel:in_lieu_of": [
|
|
460
481
|
"23a1",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# ADR 0009 — `data/version.json` is the single version stamp for `data/`
|
|
2
|
+
|
|
3
|
+
Date: 2026-09-08
|
|
4
|
+
Status: accepted
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
Nothing in this package's schema or data files carries a version anywhere a
|
|
9
|
+
consumer can check it against. colregs-engine's `Evaluation.colregs.version`
|
|
10
|
+
names the engine's own resolved npm dependency, not the `data` object it was
|
|
11
|
+
actually handed — so a caller evaluating against a stale cached fixture, a
|
|
12
|
+
monorepo with mismatched `colregs` versions, or applicability data
|
|
13
|
+
reconstructed by hand from an old export gets a result silently attributed
|
|
14
|
+
to whatever release happens to be resolved locally: not a crash, not a
|
|
15
|
+
warning, just a wrong-but-plausible `Evaluation`.
|
|
16
|
+
|
|
17
|
+
Two alternatives were considered and rejected:
|
|
18
|
+
|
|
19
|
+
- **A `version`/`dataVersion` field on each of the seven `data/*.json`
|
|
20
|
+
files.** The files already release as one unit — one npm version, one
|
|
21
|
+
`package.json` — so seven independent copies can only drift, never add
|
|
22
|
+
information.
|
|
23
|
+
- **Leaning on the npm package version alone (status quo).** That is
|
|
24
|
+
exactly what colregs-engine already does, and exactly what it cannot
|
|
25
|
+
verify against, because the installed package version and the data
|
|
26
|
+
actually passed into `evaluate()` are two different things once the data
|
|
27
|
+
crosses a process/cache/file boundary.
|
|
28
|
+
|
|
29
|
+
## Decision
|
|
30
|
+
|
|
31
|
+
A single manifest, `data/version.json`, is the one source of truth:
|
|
32
|
+
|
|
33
|
+
- `{"version": "<semver>"}`, matching `package.json` at release time.
|
|
34
|
+
- `schema/version.schema.json` validates it, same pattern as every other
|
|
35
|
+
`data/*.json` file.
|
|
36
|
+
- `release-please-config.json`'s `extra-files` generic JSON updater keeps
|
|
37
|
+
it in sync on every release, the same way `.release-please-manifest.json`
|
|
38
|
+
already is — the version cannot go stale without the release itself
|
|
39
|
+
failing.
|
|
40
|
+
|
|
41
|
+
## Consequences
|
|
42
|
+
|
|
43
|
+
- colregs-engine (or any consumer) can compare its resolved package version
|
|
44
|
+
against `data/version.json` at the point `evaluate()` receives `data`,
|
|
45
|
+
and throw or warn on a mismatch instead of silently reporting the wrong
|
|
46
|
+
version. That comparison is a colregs-engine change, tracked separately.
|
|
47
|
+
- `data/version.json` is never hand-edited; release-please owns it.
|
package/docs/budgets.json
CHANGED
|
@@ -362,6 +362,23 @@
|
|
|
362
362
|
"24a-rest"
|
|
363
363
|
]
|
|
364
364
|
},
|
|
365
|
+
{
|
|
366
|
+
"name": "towing astern, at anchor (issue #44: Rule 23 running lights not imported)",
|
|
367
|
+
"facts": {
|
|
368
|
+
"fact:propulsion": "propulsion:power",
|
|
369
|
+
"fact:activity": "activity:towing",
|
|
370
|
+
"fact:position": "position:anchored",
|
|
371
|
+
"fact:length_m": 40,
|
|
372
|
+
"fact:tow_length_m": 150
|
|
373
|
+
},
|
|
374
|
+
"expect": [
|
|
375
|
+
"24a-m2",
|
|
376
|
+
"24a-rest",
|
|
377
|
+
"30a",
|
|
378
|
+
"30b",
|
|
379
|
+
"30c"
|
|
380
|
+
]
|
|
381
|
+
},
|
|
365
382
|
{
|
|
366
383
|
"name": "pushing ahead, composite unit",
|
|
367
384
|
"facts": {
|
|
@@ -375,6 +392,22 @@
|
|
|
375
392
|
"24b"
|
|
376
393
|
]
|
|
377
394
|
},
|
|
395
|
+
{
|
|
396
|
+
"name": "pushing ahead, composite unit, at anchor (issue #44: Rule 23 running lights not imported)",
|
|
397
|
+
"facts": {
|
|
398
|
+
"fact:propulsion": "propulsion:power",
|
|
399
|
+
"fact:activity": "activity:pushing",
|
|
400
|
+
"fact:position": "position:anchored",
|
|
401
|
+
"fact:length_m": 30,
|
|
402
|
+
"fact:composite_unit": true
|
|
403
|
+
},
|
|
404
|
+
"expect": [
|
|
405
|
+
"24b",
|
|
406
|
+
"30a",
|
|
407
|
+
"30b",
|
|
408
|
+
"30c"
|
|
409
|
+
]
|
|
410
|
+
},
|
|
378
411
|
{
|
|
379
412
|
"name": "pushing ahead, not a composite unit",
|
|
380
413
|
"facts": {
|
|
@@ -388,6 +421,22 @@
|
|
|
388
421
|
"24c"
|
|
389
422
|
]
|
|
390
423
|
},
|
|
424
|
+
{
|
|
425
|
+
"name": "pushing ahead, not a composite unit, at anchor (issue #44: Rule 23 running lights not imported)",
|
|
426
|
+
"facts": {
|
|
427
|
+
"fact:propulsion": "propulsion:power",
|
|
428
|
+
"fact:activity": "activity:pushing",
|
|
429
|
+
"fact:position": "position:anchored",
|
|
430
|
+
"fact:length_m": 30,
|
|
431
|
+
"fact:composite_unit": false
|
|
432
|
+
},
|
|
433
|
+
"expect": [
|
|
434
|
+
"24c",
|
|
435
|
+
"30a",
|
|
436
|
+
"30b",
|
|
437
|
+
"30c"
|
|
438
|
+
]
|
|
439
|
+
},
|
|
391
440
|
{
|
|
392
441
|
"name": "constrained by draft",
|
|
393
442
|
"facts": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "colregs",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
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": {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/mark-brannan/colregs/schema/version.schema.json",
|
|
4
|
+
"title": "data/version.json",
|
|
5
|
+
"description": "The single version stamp for all of data/ and fixtures/, mirroring package.json's version at release time. One source of truth -- see docs/adr/0009-data-version-stamp.md (release-please's extra-files generic JSON updater keeps this in sync; never hand-edit). Structure only -- see docs/adr/0006-json-schema-and-identifier-diff.md.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["version"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"version": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
13
|
+
"description": "Matches package.json's version at release time (REQ-VERIFY; docs/adr/0009-data-version-stamp.md). Not hand-edited -- release-please's extra-files JSON updater stamps it on every release."
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|