@mailwoman/corpus 11.3.0 → 11.4.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.
- package/data/PROVENANCE.md +3 -4
- package/data/address-source-register.json +4 -4
- package/data/builds/v0.8.23-overlay/OVERLAY_PLAN.json +3656 -0
- package/data/builds/v0.8.23-prominent-overlay/OVERLAY_PLAN.json +42 -0
- package/data/builds/v0.8.23-rebuild/inputs.json +141 -0
- package/data/builds/v0.8.24-rebuild/inputs.json +111 -0
- package/data/corpus-source-inputs.json +95 -1
- package/data/holdout/evaluation-groups.v0.8.24.json +222158 -0
- package/data/license-decisions.json +5 -0
- package/data/region-slot-second-level.json +1 -1
- package/data/training-configs/v8.11.0-base-c6-90k-v0823-s42.yaml +920 -0
- package/data/training-configs/v8.12.0-base-c6-wofreps-v0823-s42.yaml +944 -0
- package/data/training-configs/v8.13.0-base-c6-wofreps-v0822-s42.yaml +918 -0
- package/lib/adapters/cordis/adapter.ts +3 -2
- package/lib/adapters/gleif/adapter.ts +123 -20
- package/lib/adapters/openaddresses/adapter.ts +2 -2
- package/lib/adapters/osm/adapter.ts +62 -4
- package/lib/adapters/overture/adapter.ts +97 -15
- package/lib/adapters/overture/address-key.ts +89 -0
- package/lib/adapters/overture/places-in/adapter.ts +258 -0
- package/lib/adapters/street/convention.ts +49 -0
- package/lib/adapters/street/country-line.ts +65 -0
- package/lib/adapters/wof/admin/json/adapter.ts +4 -4
- package/lib/adapters/wof/admin/json/region-codes.ts +98 -0
- package/lib/adapters/wof/json-rows.ts +2 -2
- package/lib/adapters.ts +2 -0
- package/lib/build/align/range.ts +21 -11
- package/lib/build/align/totals.ts +20 -0
- package/lib/build/align.ts +218 -20
- package/lib/build/budget.ts +55 -20
- package/lib/build/checkpoint.ts +9 -0
- package/lib/build/component-check.ts +97 -3
- package/lib/build/inputs.ts +122 -31
- package/lib/build/manifest.ts +1 -0
- package/lib/build/parallel.ts +140 -23
- package/lib/build/{region-names.ts → region/names.ts} +16 -4
- package/lib/build/region/recount.ts +153 -0
- package/lib/build/reuse.ts +112 -0
- package/lib/build/settings.ts +84 -3
- package/lib/build/source-record.ts +45 -8
- package/lib/build/types.ts +26 -0
- package/lib/build/worker.ts +75 -10
- package/lib/build.ts +2 -1
- package/lib/de/recipes/locale.ts +9 -3
- package/lib/evaluation/corpus-adapter.ts +2 -2
- package/lib/fi/adapters/ryhti/adapter.ts +2 -2
- package/lib/fo/adapters/adressur/adapter.ts +2 -2
- package/lib/fr/recipes/lieudit.ts +3 -4
- package/lib/in/street-line/segment.ts +370 -0
- package/lib/international/recipes/locale.ts +6 -3
- package/lib/li/adapters/llv/adapter.ts +2 -2
- package/lib/lu/adapters/bd-adresses/adapter.ts +2 -2
- package/lib/no/adapters/matrikkelen/adapter.ts +2 -2
- package/lib/parquet/streams.ts +18 -3
- package/lib/parquet/writers.ts +161 -29
- package/lib/recipes/country-balanced.ts +32 -18
- package/lib/recipes/fragment-assay/build.ts +8 -5
- package/lib/recipes/fragment-assay/rows.ts +4 -4
- package/lib/recipes/house/venue.ts +2 -1
- package/lib/recipes/postal/guideline/leg.ts +3 -2
- package/lib/recipes/prominent/places.ts +4 -4
- package/lib/runner.ts +139 -20
- package/lib/sg/recipes/register.ts +6 -1
- package/lib/source-register/row-license.ts +12 -2
- package/lib/surfaces/corpus-row.ts +84 -0
- package/lib/surfaces/locale.ts +20 -24
- package/lib/synthesizers/house-venue.ts +33 -40
- package/lib/synthesizers/no-street.ts +2 -2
- package/lib/synthesizers/po-box.ts +3 -3
- package/lib/synthesizers/tail.ts +3 -2
- package/lib/synthesizers/utils.ts +95 -56
- package/lib/test-kit.ts +50 -1
- package/lib/tools/fetch/overture-places-in.ts +118 -0
- package/lib/tools/fetch/storage.ts +3 -0
- package/lib/tools/fetch.ts +2 -0
- package/lib/tools/region-slot-census.run.ts +2 -2
- package/lib/types.ts +39 -0
- package/lib/us/adapters/state/tx-notaries/adapter.ts +2 -1
- package/lib/us/adapters/usgov/imls-pls/adapter.ts +2 -1
- package/lib/us/adapters/usgov/nad/adapter.ts +32 -4
- package/lib/us/adapters/usgov/nad/address-key.ts +8 -47
- package/lib/us/adapters/usgov/nppes/adapter.ts +2 -1
- package/lib/utils/address-key.ts +57 -0
- package/lib/utils/align.ts +22 -10
- package/lib/utils/evaluation-groups.ts +13 -6
- package/lib/utils/split.ts +24 -3
- package/out/adapters/cordis/adapter.d.ts.map +1 -1
- package/out/adapters/cordis/adapter.js +3 -2
- package/out/adapters/cordis/adapter.js.map +1 -1
- package/out/adapters/gleif/adapter.d.ts +4 -0
- package/out/adapters/gleif/adapter.d.ts.map +1 -1
- package/out/adapters/gleif/adapter.js +100 -20
- package/out/adapters/gleif/adapter.js.map +1 -1
- package/out/adapters/openaddresses/adapter.js +2 -2
- package/out/adapters/openaddresses/adapter.js.map +1 -1
- package/out/adapters/osm/adapter.d.ts +9 -0
- package/out/adapters/osm/adapter.d.ts.map +1 -1
- package/out/adapters/osm/adapter.js +55 -13
- package/out/adapters/osm/adapter.js.map +1 -1
- package/out/adapters/overture/adapter.d.ts +6 -0
- package/out/adapters/overture/adapter.d.ts.map +1 -1
- package/out/adapters/overture/adapter.js +72 -9
- package/out/adapters/overture/adapter.js.map +1 -1
- package/out/adapters/overture/address-key.d.ts +39 -0
- package/out/adapters/overture/address-key.d.ts.map +1 -0
- package/out/adapters/overture/address-key.js +75 -0
- package/out/adapters/overture/address-key.js.map +1 -0
- package/out/adapters/overture/places-in/adapter.d.ts +20 -0
- package/out/adapters/overture/places-in/adapter.d.ts.map +1 -0
- package/out/adapters/overture/places-in/adapter.js +191 -0
- package/out/adapters/overture/places-in/adapter.js.map +1 -0
- package/out/adapters/street/convention.d.ts +11 -0
- package/out/adapters/street/convention.d.ts.map +1 -0
- package/out/adapters/street/convention.js +40 -0
- package/out/adapters/street/convention.js.map +1 -0
- package/out/adapters/street/country-line.d.ts +31 -0
- package/out/adapters/street/country-line.d.ts.map +1 -0
- package/out/adapters/street/country-line.js +31 -0
- package/out/adapters/street/country-line.js.map +1 -0
- package/out/adapters/wof/admin/json/adapter.js +4 -4
- package/out/adapters/wof/admin/json/adapter.js.map +1 -1
- package/out/adapters/wof/admin/json/region-codes.d.ts +5 -0
- package/out/adapters/wof/admin/json/region-codes.d.ts.map +1 -1
- package/out/adapters/wof/admin/json/region-codes.js +83 -0
- package/out/adapters/wof/admin/json/region-codes.js.map +1 -1
- package/out/adapters/wof/json-rows.d.ts.map +1 -1
- package/out/adapters/wof/json-rows.js +2 -2
- package/out/adapters/wof/json-rows.js.map +1 -1
- package/out/adapters.d.ts.map +1 -1
- package/out/adapters.js +2 -0
- package/out/adapters.js.map +1 -1
- package/out/build/align/range.d.ts +7 -3
- package/out/build/align/range.d.ts.map +1 -1
- package/out/build/align/range.js +17 -9
- package/out/build/align/range.js.map +1 -1
- package/out/build/align/totals.d.ts +12 -0
- package/out/build/align/totals.d.ts.map +1 -1
- package/out/build/align/totals.js +8 -0
- package/out/build/align/totals.js.map +1 -1
- package/out/build/align.d.ts +60 -5
- package/out/build/align.d.ts.map +1 -1
- package/out/build/align.js +136 -12
- package/out/build/align.js.map +1 -1
- package/out/build/budget.d.ts +35 -11
- package/out/build/budget.d.ts.map +1 -1
- package/out/build/budget.js +52 -20
- package/out/build/budget.js.map +1 -1
- package/out/build/checkpoint.d.ts +9 -0
- package/out/build/checkpoint.d.ts.map +1 -1
- package/out/build/checkpoint.js.map +1 -1
- package/out/build/component-check.d.ts +29 -1
- package/out/build/component-check.d.ts.map +1 -1
- package/out/build/component-check.js +57 -2
- package/out/build/component-check.js.map +1 -1
- package/out/build/inputs.d.ts +58 -0
- package/out/build/inputs.d.ts.map +1 -1
- package/out/build/inputs.js +57 -20
- package/out/build/inputs.js.map +1 -1
- package/out/build/manifest.d.ts.map +1 -1
- package/out/build/manifest.js +1 -0
- package/out/build/manifest.js.map +1 -1
- package/out/build/parallel.d.ts +19 -1
- package/out/build/parallel.d.ts.map +1 -1
- package/out/build/parallel.js +92 -11
- package/out/build/parallel.js.map +1 -1
- package/out/build/{region-names.d.ts → region/names.d.ts} +10 -1
- package/out/build/region/names.d.ts.map +1 -0
- package/out/build/{region-names.js → region/names.js} +16 -5
- package/out/build/region/names.js.map +1 -0
- package/out/build/region/recount.d.ts +47 -0
- package/out/build/region/recount.d.ts.map +1 -0
- package/out/build/region/recount.js +105 -0
- package/out/build/region/recount.js.map +1 -0
- package/out/build/reuse.d.ts +31 -0
- package/out/build/reuse.d.ts.map +1 -0
- package/out/build/reuse.js +50 -0
- package/out/build/reuse.js.map +1 -0
- package/out/build/settings.d.ts +38 -0
- package/out/build/settings.d.ts.map +1 -1
- package/out/build/settings.js +67 -3
- package/out/build/settings.js.map +1 -1
- package/out/build/source-record.d.ts +32 -7
- package/out/build/source-record.d.ts.map +1 -1
- package/out/build/source-record.js +17 -4
- package/out/build/source-record.js.map +1 -1
- package/out/build/types.d.ts +24 -0
- package/out/build/types.d.ts.map +1 -1
- package/out/build/worker.d.ts +17 -0
- package/out/build/worker.d.ts.map +1 -1
- package/out/build/worker.js +44 -9
- package/out/build/worker.js.map +1 -1
- package/out/build.d.ts.map +1 -1
- package/out/build.js +2 -1
- package/out/build.js.map +1 -1
- package/out/de/recipes/locale.d.ts.map +1 -1
- package/out/de/recipes/locale.js +9 -3
- package/out/de/recipes/locale.js.map +1 -1
- package/out/evaluation/corpus-adapter.d.ts +14 -0
- package/out/evaluation/corpus-adapter.d.ts.map +1 -1
- package/out/evaluation/corpus-adapter.js +2 -16
- package/out/evaluation/corpus-adapter.js.map +1 -1
- package/out/fi/adapters/ryhti/adapter.js +2 -2
- package/out/fi/adapters/ryhti/adapter.js.map +1 -1
- package/out/fo/adapters/adressur/adapter.js +2 -2
- package/out/fo/adapters/adressur/adapter.js.map +1 -1
- package/out/fr/recipes/lieudit.d.ts.map +1 -1
- package/out/fr/recipes/lieudit.js +3 -3
- package/out/fr/recipes/lieudit.js.map +1 -1
- package/out/in/street-line/segment.d.ts +75 -0
- package/out/in/street-line/segment.d.ts.map +1 -0
- package/out/in/street-line/segment.js +298 -0
- package/out/in/street-line/segment.js.map +1 -0
- package/out/international/recipes/locale.d.ts.map +1 -1
- package/out/international/recipes/locale.js +6 -3
- package/out/international/recipes/locale.js.map +1 -1
- package/out/li/adapters/llv/adapter.js +2 -2
- package/out/li/adapters/llv/adapter.js.map +1 -1
- package/out/lu/adapters/bd-adresses/adapter.js +2 -2
- package/out/lu/adapters/bd-adresses/adapter.js.map +1 -1
- package/out/no/adapters/matrikkelen/adapter.js +2 -2
- package/out/no/adapters/matrikkelen/adapter.js.map +1 -1
- package/out/parquet/streams.d.ts +9 -0
- package/out/parquet/streams.d.ts.map +1 -1
- package/out/parquet/streams.js +7 -3
- package/out/parquet/streams.js.map +1 -1
- package/out/parquet/writers.d.ts +55 -2
- package/out/parquet/writers.d.ts.map +1 -1
- package/out/parquet/writers.js +109 -27
- package/out/parquet/writers.js.map +1 -1
- package/out/recipes/country-balanced.d.ts.map +1 -1
- package/out/recipes/country-balanced.js +32 -15
- package/out/recipes/country-balanced.js.map +1 -1
- package/out/recipes/fragment-assay/build.d.ts +5 -2
- package/out/recipes/fragment-assay/build.d.ts.map +1 -1
- package/out/recipes/fragment-assay/build.js +8 -5
- package/out/recipes/fragment-assay/build.js.map +1 -1
- package/out/recipes/fragment-assay/rows.d.ts +2 -2
- package/out/recipes/fragment-assay/rows.js +4 -4
- package/out/recipes/fragment-assay/rows.js.map +1 -1
- package/out/recipes/house/venue.d.ts.map +1 -1
- package/out/recipes/house/venue.js +2 -1
- package/out/recipes/house/venue.js.map +1 -1
- package/out/recipes/postal/guideline/leg.d.ts.map +1 -1
- package/out/recipes/postal/guideline/leg.js +2 -7
- package/out/recipes/postal/guideline/leg.js.map +1 -1
- package/out/recipes/prominent/places.js +4 -4
- package/out/recipes/prominent/places.js.map +1 -1
- package/out/runner.d.ts +28 -0
- package/out/runner.d.ts.map +1 -1
- package/out/runner.js +85 -18
- package/out/runner.js.map +1 -1
- package/out/sg/recipes/register.d.ts.map +1 -1
- package/out/sg/recipes/register.js +6 -1
- package/out/sg/recipes/register.js.map +1 -1
- package/out/source-register/row-license.d.ts +8 -0
- package/out/source-register/row-license.d.ts.map +1 -1
- package/out/source-register/row-license.js +10 -2
- package/out/source-register/row-license.js.map +1 -1
- package/out/surfaces/corpus-row.d.ts +32 -0
- package/out/surfaces/corpus-row.d.ts.map +1 -0
- package/out/surfaces/corpus-row.js +70 -0
- package/out/surfaces/corpus-row.js.map +1 -0
- package/out/surfaces/locale.d.ts.map +1 -1
- package/out/surfaces/locale.js +16 -22
- package/out/surfaces/locale.js.map +1 -1
- package/out/synthesizers/house-venue.d.ts +9 -4
- package/out/synthesizers/house-venue.d.ts.map +1 -1
- package/out/synthesizers/house-venue.js +25 -35
- package/out/synthesizers/house-venue.js.map +1 -1
- package/out/synthesizers/no-street.js +2 -9
- package/out/synthesizers/no-street.js.map +1 -1
- package/out/synthesizers/po-box.js +3 -7
- package/out/synthesizers/po-box.js.map +1 -1
- package/out/synthesizers/tail.d.ts.map +1 -1
- package/out/synthesizers/tail.js +2 -2
- package/out/synthesizers/tail.js.map +1 -1
- package/out/synthesizers/utils.d.ts +20 -3
- package/out/synthesizers/utils.d.ts.map +1 -1
- package/out/synthesizers/utils.js +74 -57
- package/out/synthesizers/utils.js.map +1 -1
- package/out/test-kit.d.ts +11 -0
- package/out/test-kit.d.ts.map +1 -1
- package/out/test-kit.js +30 -1
- package/out/test-kit.js.map +1 -1
- package/out/tools/fetch/overture-places-in.d.ts +14 -0
- package/out/tools/fetch/overture-places-in.d.ts.map +1 -0
- package/out/tools/fetch/overture-places-in.js +82 -0
- package/out/tools/fetch/overture-places-in.js.map +1 -0
- package/out/tools/fetch/storage.d.ts +2 -0
- package/out/tools/fetch/storage.d.ts.map +1 -1
- package/out/tools/fetch/storage.js +3 -0
- package/out/tools/fetch/storage.js.map +1 -1
- package/out/tools/fetch.d.ts +2 -0
- package/out/tools/fetch.d.ts.map +1 -1
- package/out/tools/fetch.js +2 -0
- package/out/tools/fetch.js.map +1 -1
- package/out/tools/region-slot-census.run.js +2 -2
- package/out/types.d.ts +41 -0
- package/out/types.d.ts.map +1 -1
- package/out/types.js.map +1 -1
- package/out/us/adapters/state/tx-notaries/adapter.d.ts.map +1 -1
- package/out/us/adapters/state/tx-notaries/adapter.js +2 -1
- package/out/us/adapters/state/tx-notaries/adapter.js.map +1 -1
- package/out/us/adapters/usgov/imls-pls/adapter.d.ts.map +1 -1
- package/out/us/adapters/usgov/imls-pls/adapter.js +2 -1
- package/out/us/adapters/usgov/imls-pls/adapter.js.map +1 -1
- package/out/us/adapters/usgov/nad/adapter.d.ts +15 -0
- package/out/us/adapters/usgov/nad/adapter.d.ts.map +1 -1
- package/out/us/adapters/usgov/nad/adapter.js +21 -3
- package/out/us/adapters/usgov/nad/adapter.js.map +1 -1
- package/out/us/adapters/usgov/nad/address-key.d.ts +1 -5
- package/out/us/adapters/usgov/nad/address-key.d.ts.map +1 -1
- package/out/us/adapters/usgov/nad/address-key.js +8 -33
- package/out/us/adapters/usgov/nad/address-key.js.map +1 -1
- package/out/us/adapters/usgov/nppes/adapter.d.ts.map +1 -1
- package/out/us/adapters/usgov/nppes/adapter.js +2 -1
- package/out/us/adapters/usgov/nppes/adapter.js.map +1 -1
- package/out/utils/address-key.d.ts +23 -0
- package/out/utils/address-key.d.ts.map +1 -0
- package/out/utils/address-key.js +43 -0
- package/out/utils/address-key.js.map +1 -0
- package/out/utils/align.d.ts +7 -0
- package/out/utils/align.d.ts.map +1 -1
- package/out/utils/align.js +18 -8
- package/out/utils/align.js.map +1 -1
- package/out/utils/evaluation-groups.d.ts +5 -1
- package/out/utils/evaluation-groups.d.ts.map +1 -1
- package/out/utils/evaluation-groups.js +12 -1
- package/out/utils/evaluation-groups.js.map +1 -1
- package/out/utils/split.d.ts +11 -0
- package/out/utils/split.d.ts.map +1 -1
- package/out/utils/split.js +18 -3
- package/out/utils/split.js.map +1 -1
- package/package.json +19 -19
- package/out/build/region-names.d.ts.map +0 -1
- package/out/build/region-names.js.map +0 -1
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @file The `region:unknown` count of a reused source, recounted under the region data the reusing build reads.
|
|
6
|
+
*
|
|
7
|
+
* The region data changes no row's bytes, so it stays out of a source's derivation. A source written under other
|
|
8
|
+
* region data is the same work apart from that one count. A source record states the fingerprints of the region
|
|
9
|
+
* data its count was made under, and the region value of every row the check read. A reusing build recounts from
|
|
10
|
+
* those values when the fingerprints differ. A record written before the values existed can't be recounted, and is
|
|
11
|
+
* refused.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { canonicalJSON } from "@mailwoman/core/values/json"
|
|
15
|
+
|
|
16
|
+
import type { AlignTotalsRecord } from "#build/align/totals"
|
|
17
|
+
import { ComponentRule, countRegionUnknown } from "#build/component-check"
|
|
18
|
+
import type { RegionNames } from "#build/region/names"
|
|
19
|
+
import { REGION_CHECK_INPUTS } from "#build/settings"
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The fields of a source's completion record the recount reads and writes.
|
|
23
|
+
*/
|
|
24
|
+
export interface RegionCheckedRecord {
|
|
25
|
+
source: string
|
|
26
|
+
derivation: { config: unknown }
|
|
27
|
+
totals: AlignTotalsRecord
|
|
28
|
+
/**
|
|
29
|
+
* The fingerprints of the region data the `region:unknown` count in `totals`
|
|
30
|
+
* was made under, from `regionCheckFingerprints`.
|
|
31
|
+
*
|
|
32
|
+
* A record written before the region data left the derivation holds them in `derivation.config.alignData`.
|
|
33
|
+
*/
|
|
34
|
+
regionCheck?: Record<string, string>
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The `alignData` fingerprints of a derivation's config, or `null` when it records none.
|
|
39
|
+
*/
|
|
40
|
+
function alignDataOf(config: unknown): Record<string, unknown> | null {
|
|
41
|
+
if (typeof config !== "object" || config == null) return null
|
|
42
|
+
|
|
43
|
+
const alignData = (config as Record<string, unknown>)["alignData"]
|
|
44
|
+
|
|
45
|
+
return typeof alignData === "object" && alignData != null ? (alignData as Record<string, unknown>) : null
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The fingerprints of the region data a record's count was made under: its `regionCheck`,
|
|
50
|
+
* or the region keys a record written before the field kept in its derivation's `alignData`.
|
|
51
|
+
*/
|
|
52
|
+
export function recordedRegionCheck(record: RegionCheckedRecord): Record<string, string> | null {
|
|
53
|
+
if (record.regionCheck) return record.regionCheck
|
|
54
|
+
|
|
55
|
+
const alignData = alignDataOf(record.derivation.config)
|
|
56
|
+
|
|
57
|
+
if (!alignData) return null
|
|
58
|
+
|
|
59
|
+
const recorded: Record<string, string> = {}
|
|
60
|
+
|
|
61
|
+
for (const key of REGION_CHECK_INPUTS) {
|
|
62
|
+
const fingerprint = alignData[key]
|
|
63
|
+
|
|
64
|
+
if (typeof fingerprint !== "string") return null
|
|
65
|
+
|
|
66
|
+
recorded[key] = fingerprint
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return recorded
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* A derivation with the region keys a record written before `regionCheck` kept in
|
|
74
|
+
* `alignData` left out, so a record of either age compares with this build's derivation.
|
|
75
|
+
*/
|
|
76
|
+
export function withoutRegionCheckInputs<T extends { config: unknown }>(derivation: T): T {
|
|
77
|
+
const alignData = alignDataOf(derivation.config)
|
|
78
|
+
|
|
79
|
+
if (!alignData) return derivation
|
|
80
|
+
|
|
81
|
+
const kept = Object.fromEntries(
|
|
82
|
+
Object.entries(alignData).filter(([key]) => !(REGION_CHECK_INPUTS as readonly string[]).includes(key))
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
return { ...derivation, config: { ...(derivation.config as Record<string, unknown>), alignData: kept } }
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The record with its `region:unknown` count made under the region data `current`
|
|
90
|
+
* fingerprints, or why it can't be.
|
|
91
|
+
*
|
|
92
|
+
* A record already made under `current` comes back with only its `regionCheck` set.
|
|
93
|
+
* Under `regions` null the count is removed and the rule listed as unchecked,
|
|
94
|
+
* as an align without the database writes.
|
|
95
|
+
*/
|
|
96
|
+
export async function recountRegionCheck<T extends RegionCheckedRecord>(
|
|
97
|
+
record: T,
|
|
98
|
+
current: Record<string, string>,
|
|
99
|
+
readRegions: () => Promise<RegionNames | null>
|
|
100
|
+
): Promise<{ record: T; problem: null } | { record: null; problem: string }> {
|
|
101
|
+
const recorded = recordedRegionCheck(record)
|
|
102
|
+
|
|
103
|
+
if (recorded && canonicalJSON(recorded) === canonicalJSON(current)) {
|
|
104
|
+
return { record: { ...record, regionCheck: current }, problem: null }
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const values = record.totals.region_values
|
|
108
|
+
|
|
109
|
+
if (!values) {
|
|
110
|
+
return {
|
|
111
|
+
record: null,
|
|
112
|
+
problem:
|
|
113
|
+
`${record.source}'s record was made under other region data and records no region values, ` +
|
|
114
|
+
`so its region:unknown count can't be recounted`,
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const regions = await readRegions()
|
|
119
|
+
const unknown = regions ? countRegionUnknown(values, regions) : 0
|
|
120
|
+
|
|
121
|
+
const findings = record.totals.component_findings_by_source.map(
|
|
122
|
+
([source, rules]): [string, [ComponentRule, number][]] => [
|
|
123
|
+
source,
|
|
124
|
+
rules.filter(([rule]) => rule !== ComponentRule.RegionUnknown),
|
|
125
|
+
]
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
if (unknown > 0) {
|
|
129
|
+
const own = findings.find(([source]) => source === record.source)
|
|
130
|
+
|
|
131
|
+
if (own) {
|
|
132
|
+
own[1].push([ComponentRule.RegionUnknown, unknown])
|
|
133
|
+
} else {
|
|
134
|
+
findings.push([record.source, [[ComponentRule.RegionUnknown, unknown]]])
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const unchecked = record.totals.unchecked_component_rules.filter((rule) => rule !== ComponentRule.RegionUnknown)
|
|
139
|
+
|
|
140
|
+
return {
|
|
141
|
+
record: {
|
|
142
|
+
...record,
|
|
143
|
+
totals: {
|
|
144
|
+
...record.totals,
|
|
145
|
+
// An align counts a source only once a row of it fails a rule.
|
|
146
|
+
component_findings_by_source: findings.filter(([, rules]) => rules.length > 0),
|
|
147
|
+
unchecked_component_rules: regions ? unchecked : [...unchecked, ComponentRule.RegionUnknown],
|
|
148
|
+
},
|
|
149
|
+
regionCheck: current,
|
|
150
|
+
},
|
|
151
|
+
problem: null,
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @file Reusing a finished source from an earlier build's output directory.
|
|
6
|
+
*
|
|
7
|
+
* A source's files depend on its input, the code its producer reaches, the data files align reads and the build
|
|
8
|
+
* settings. They don't depend on the corpus version, because rows hold no version, or on the builder version once
|
|
9
|
+
* the code hash covers the code. A source whose derivation and settings match apart from those two fields is
|
|
10
|
+
* therefore the same work, and a build may take it from an earlier build instead of running it again.
|
|
11
|
+
*
|
|
12
|
+
* An import clones each file the source's record lists into this build's output directory, at the same path
|
|
13
|
+
* relative to the output root, and writes the record with the new paths. On btrfs a clone shares the earlier
|
|
14
|
+
* file's blocks. The imported record keeps the earlier build's settings and derivation, because its files were
|
|
15
|
+
* written under them. Its `reusedFrom` field records the directory it came from.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import type { RecordedFile } from "@mailwoman/core/crypto/hash"
|
|
19
|
+
import { cloneFileTo, writeLocalJSONFile } from "@mailwoman/core/fs/writers"
|
|
20
|
+
import { isAbsolute, PathBuilder, relative, resolvePath, type PathBuilderLike } from "path-ts"
|
|
21
|
+
|
|
22
|
+
import {
|
|
23
|
+
readReusableSource,
|
|
24
|
+
SOURCE_RECORD_FILE,
|
|
25
|
+
sourceStateDirectory,
|
|
26
|
+
type ExpectedSource,
|
|
27
|
+
type SourceCompletionRecord,
|
|
28
|
+
} from "#build/source-record"
|
|
29
|
+
import { recordPathFor } from "#parquet/record"
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Where an import reads from and writes to.
|
|
33
|
+
*/
|
|
34
|
+
export interface SourceImport {
|
|
35
|
+
source: string
|
|
36
|
+
/**
|
|
37
|
+
* The earlier build's `--out`.
|
|
38
|
+
*/
|
|
39
|
+
priorOutputDir: PathBuilderLike
|
|
40
|
+
/**
|
|
41
|
+
* This build's `--out`.
|
|
42
|
+
*/
|
|
43
|
+
outputDir: PathBuilderLike
|
|
44
|
+
expected: ExpectedSource
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Import one source from an earlier build, or return why it can't be.
|
|
49
|
+
*
|
|
50
|
+
* Before any file is cloned, {@linkcode readReusableSource} checks the earlier record across builds.
|
|
51
|
+
* It re-hashes every file the record lists.
|
|
52
|
+
*/
|
|
53
|
+
export async function importPriorSource(
|
|
54
|
+
opts: SourceImport
|
|
55
|
+
): Promise<{ record: SourceCompletionRecord; problem: null } | { record: null; problem: string }> {
|
|
56
|
+
const priorRoot = PathBuilder.from(opts.priorOutputDir)
|
|
57
|
+
const priorSourceDir = sourceStateDirectory(priorRoot("intermediate"), opts.source)
|
|
58
|
+
const reusable = await readReusableSource(priorSourceDir, opts.expected, { acrossBuilds: true })
|
|
59
|
+
|
|
60
|
+
if (!reusable.record) return reusable
|
|
61
|
+
|
|
62
|
+
const prior = reusable.record
|
|
63
|
+
|
|
64
|
+
const moved = (path: string): string => {
|
|
65
|
+
const inside = relative(priorRoot.toString(), path)
|
|
66
|
+
|
|
67
|
+
if (inside.startsWith("..") || isAbsolute(inside)) {
|
|
68
|
+
throw new Error(`importPriorSource: ${path} is outside ${priorRoot.toString()}, so it has no place in this build`)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return resolvePath(opts.outputDir, inside).toString()
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const clone = async (path: string): Promise<string> => {
|
|
75
|
+
const destination = moved(path)
|
|
76
|
+
|
|
77
|
+
await cloneFileTo(path, destination)
|
|
78
|
+
|
|
79
|
+
return destination
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const cloneRecorded = async (file: RecordedFile): Promise<RecordedFile> => ({ ...file, path: await clone(file.path) })
|
|
83
|
+
|
|
84
|
+
const parts = await Promise.all(
|
|
85
|
+
prior.parts.map(async (part) => {
|
|
86
|
+
await clone(recordPathFor(part.path))
|
|
87
|
+
|
|
88
|
+
return { ...part, path: await clone(part.path) }
|
|
89
|
+
})
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
const sourceIDs = Object.fromEntries(
|
|
93
|
+
await Promise.all(Object.entries(prior.sourceIDs).map(async ([split, file]) => [split, await cloneRecorded(file)]))
|
|
94
|
+
) as SourceCompletionRecord["sourceIDs"]
|
|
95
|
+
|
|
96
|
+
const record: SourceCompletionRecord = {
|
|
97
|
+
...prior,
|
|
98
|
+
adapter: { ...prior.adapter, jsonl_path: await clone(prior.adapter.jsonl_path) },
|
|
99
|
+
parts,
|
|
100
|
+
sourceIDs,
|
|
101
|
+
quarantine: await Promise.all(prior.quarantine.map(cloneRecorded)),
|
|
102
|
+
reusedFrom: priorRoot.toString(),
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// The record goes last, so a record on disk means every file it lists was cloned first.
|
|
106
|
+
await writeLocalJSONFile(
|
|
107
|
+
record,
|
|
108
|
+
sourceStateDirectory(PathBuilder.from(opts.outputDir)("intermediate"), opts.source)(SOURCE_RECORD_FILE)
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
return { record, problem: null }
|
|
112
|
+
}
|
package/lib/build/settings.ts
CHANGED
|
@@ -9,14 +9,17 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { sha256Hex } from "@mailwoman/core/crypto/hash"
|
|
12
|
+
import { pathExists } from "@mailwoman/core/fs/readers/stat"
|
|
12
13
|
import { canonicalJSON } from "@mailwoman/core/values/json"
|
|
13
14
|
import { LicensePolicy } from "@mailwoman/license/policy"
|
|
14
15
|
|
|
15
16
|
import { adapterModules, moduleGraphHashes } from "#build/code-hash"
|
|
17
|
+
import { defaultRegionNameInputs } from "#build/region/names"
|
|
16
18
|
import { BuildProfile, PriorOutput, type BuildCorpusOptions } from "#build/types"
|
|
17
19
|
import { extractFingerprint, type FileDerivation, inputCheckouts } from "#parquet/record"
|
|
18
20
|
import { ROWS_PER_FILE } from "#parquet/schema"
|
|
19
21
|
import { DEFAULT_SHUFFLE_SEED, DEFAULT_SHUFFLE_WINDOW } from "#parquet/shuffle"
|
|
22
|
+
import { committedRowLicenseInputs } from "#source-register/row-license"
|
|
20
23
|
import type { AdapterOptions, CorpusAdapter } from "#types"
|
|
21
24
|
import type { CountryHoldout } from "#utils/split"
|
|
22
25
|
|
|
@@ -77,12 +80,85 @@ export function derivationConfig(
|
|
|
77
80
|
* row keeps its ancestor's `source`, and the runner deduplicates within one adapter's run.
|
|
78
81
|
* A source's files therefore read only that adapter's input.
|
|
79
82
|
*
|
|
83
|
+
* A street index enters as its file's fingerprint, because a rebuilt index at the
|
|
84
|
+
* same path changes how the unit splitter reads a street.
|
|
85
|
+
*
|
|
80
86
|
* `outputDir` is left out: it locates an adapter's side state and doesn't change a row.
|
|
87
|
+
* A partition's `rowRange` and `duckdb` limits are left out because a partitioned
|
|
88
|
+
* run writes the bytes of one unpartitioned run.
|
|
89
|
+
*
|
|
90
|
+
* `trainShare` is left out because align applies it after the adapter,
|
|
91
|
+
* so the adapter run stays reusable when it changes.
|
|
92
|
+
* It enters the source's parquet derivation instead.
|
|
81
93
|
*/
|
|
82
94
|
export async function adapterExtractHash(options: AdapterOptions): Promise<string> {
|
|
83
|
-
const {
|
|
95
|
+
const {
|
|
96
|
+
inputPath,
|
|
97
|
+
outputDir: _outputDir,
|
|
98
|
+
trainShare: _trainShare,
|
|
99
|
+
rowRange: _rowRange,
|
|
100
|
+
duckdb: _duckdb,
|
|
101
|
+
streetIndex,
|
|
102
|
+
...rest
|
|
103
|
+
} = options
|
|
104
|
+
|
|
105
|
+
return sha256Hex(
|
|
106
|
+
canonicalJSON({
|
|
107
|
+
...rest,
|
|
108
|
+
...(streetIndex ? { streetIndex: await extractFingerprint(streetIndex) } : {}),
|
|
109
|
+
input: await extractFingerprint(inputPath),
|
|
110
|
+
})
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const fingerprintOf = async (path: string): Promise<string> =>
|
|
115
|
+
(await pathExists(path)) ? extractFingerprint(path) : "absent"
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The fingerprint of each data file that changes an aligned row, keyed by its role.
|
|
119
|
+
*
|
|
120
|
+
* The code hash follows module imports and so misses a file read at run time.
|
|
121
|
+
* An edited source register or corpus-source input table changes a row's license,
|
|
122
|
+
* so each one enters every source's derivation.
|
|
123
|
+
*/
|
|
124
|
+
export async function alignDataFingerprints(): Promise<Record<string, string>> {
|
|
125
|
+
const licenses = committedRowLicenseInputs()
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
sourceRegister: await fingerprintOf(licenses.register),
|
|
129
|
+
corpusSourceInputs: await fingerprintOf(licenses.corpusSourceInputs),
|
|
130
|
+
}
|
|
131
|
+
}
|
|
84
132
|
|
|
85
|
-
|
|
133
|
+
/**
|
|
134
|
+
* The keys {@linkcode regionCheckFingerprints} returns.
|
|
135
|
+
*
|
|
136
|
+
* A source record written before the region data left the derivation holds
|
|
137
|
+
* them in its derivation's `alignData`.
|
|
138
|
+
*/
|
|
139
|
+
export const REGION_CHECK_INPUTS = ["regionDatabase", "geonames", "secondLevelRegions"] as const
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* The fingerprint of each file the component check's `region:unknown` rule reads, keyed by its role.
|
|
143
|
+
*
|
|
144
|
+
* The region data changes no row's bytes.
|
|
145
|
+
* `region:unknown` is reported and never quarantines a row.
|
|
146
|
+
*
|
|
147
|
+
* The data changes only that rule's count, so it stays out of the derivation.
|
|
148
|
+
* A source's record states the fingerprints beside the count.
|
|
149
|
+
*
|
|
150
|
+
* A build that reuses the source under other region data recounts the rule (`#build/region/recount`).
|
|
151
|
+
*
|
|
152
|
+
* An absent database records `absent`, because align then reads no region data.
|
|
153
|
+
*/
|
|
154
|
+
export async function regionCheckFingerprints(): Promise<Record<(typeof REGION_CHECK_INPUTS)[number], string>> {
|
|
155
|
+
const regions = defaultRegionNameInputs()
|
|
156
|
+
|
|
157
|
+
return {
|
|
158
|
+
regionDatabase: await fingerprintOf(regions.database),
|
|
159
|
+
geonames: await fingerprintOf(regions.geonamesDirectory),
|
|
160
|
+
secondLevelRegions: await fingerprintOf(regions.secondLevelTable),
|
|
161
|
+
}
|
|
86
162
|
}
|
|
87
163
|
|
|
88
164
|
/**
|
|
@@ -108,6 +184,7 @@ export async function adapterDerivations(
|
|
|
108
184
|
)
|
|
109
185
|
|
|
110
186
|
const derived = new Map<string, Promise<FileDerivation>>()
|
|
187
|
+
const alignData = alignDataFingerprints()
|
|
111
188
|
|
|
112
189
|
return Object.assign(derivationOf, { modules })
|
|
113
190
|
|
|
@@ -132,7 +209,11 @@ export async function adapterDerivations(
|
|
|
132
209
|
return {
|
|
133
210
|
extractHash: await adapterExtractHash(options),
|
|
134
211
|
codeHash,
|
|
135
|
-
config
|
|
212
|
+
config: {
|
|
213
|
+
...config,
|
|
214
|
+
alignData: await alignData,
|
|
215
|
+
...(typeof options.trainShare === "number" ? { trainShare: options.trainShare } : {}),
|
|
216
|
+
},
|
|
136
217
|
...(await inputCheckouts(options.inputPath)),
|
|
137
218
|
}
|
|
138
219
|
}
|
|
@@ -16,8 +16,9 @@ import { tryStat } from "@mailwoman/core/fs/readers/stat"
|
|
|
16
16
|
import { canonicalJSON } from "@mailwoman/core/values/json"
|
|
17
17
|
import { PathBuilder, type PathBuilderLike } from "path-ts"
|
|
18
18
|
|
|
19
|
-
import type { AlignTotalsRecord } from "#build/align/totals"
|
|
20
19
|
import type { AlignSettings } from "#build/checkpoint"
|
|
20
|
+
import type { RegionNames } from "#build/region/names"
|
|
21
|
+
import { type RegionCheckedRecord, recountRegionCheck, withoutRegionCheckInputs } from "#build/region/recount"
|
|
21
22
|
import { readParquetRecord, type DerivationInputs } from "#parquet/record"
|
|
22
23
|
import type { ParquetFileDescriptor } from "#parquet/writers"
|
|
23
24
|
import type { AdapterRunManifest } from "#runner"
|
|
@@ -44,8 +45,7 @@ export interface SourceBuildSettings {
|
|
|
44
45
|
/**
|
|
45
46
|
* A finished source.
|
|
46
47
|
*/
|
|
47
|
-
export interface SourceCompletionRecord {
|
|
48
|
-
source: string
|
|
48
|
+
export interface SourceCompletionRecord extends RegionCheckedRecord {
|
|
49
49
|
settings: SourceBuildSettings
|
|
50
50
|
/**
|
|
51
51
|
* The derivation every one of the source's parquet files was written under,
|
|
@@ -72,8 +72,12 @@ export interface SourceCompletionRecord {
|
|
|
72
72
|
* The quarantine files of the source's align ranges, in range order.
|
|
73
73
|
*/
|
|
74
74
|
quarantine: RecordedFile[]
|
|
75
|
-
totals: AlignTotalsRecord
|
|
76
75
|
completed_at: string
|
|
76
|
+
/**
|
|
77
|
+
* The earlier build's output directory the source's files were cloned from,
|
|
78
|
+
* when `--reuse-from` imported it.
|
|
79
|
+
*/
|
|
80
|
+
reusedFrom?: string
|
|
77
81
|
}
|
|
78
82
|
|
|
79
83
|
/**
|
|
@@ -108,25 +112,58 @@ async function fileProblem(file: RecordedFile): Promise<string | null> {
|
|
|
108
112
|
return null
|
|
109
113
|
}
|
|
110
114
|
|
|
115
|
+
/**
|
|
116
|
+
* What a build expects of a source it reuses.
|
|
117
|
+
*/
|
|
118
|
+
export interface ExpectedSource {
|
|
119
|
+
settings: SourceBuildSettings
|
|
120
|
+
derivation: DerivationInputs
|
|
121
|
+
/**
|
|
122
|
+
* The fingerprints of the region data this build reads, from `regionCheckFingerprints`.
|
|
123
|
+
*/
|
|
124
|
+
regionCheck: Record<string, string>
|
|
125
|
+
/**
|
|
126
|
+
* Reads this build's region data, for a record whose count was made under other data.
|
|
127
|
+
*/
|
|
128
|
+
readRegions: () => Promise<RegionNames | null>
|
|
129
|
+
}
|
|
130
|
+
|
|
111
131
|
/**
|
|
112
132
|
* Why a source's completion record cannot be reused, or `null` with the record when it can.
|
|
113
133
|
*
|
|
114
134
|
* Every listed file is re-hashed, so a reused source is one whose bytes were read back in this build.
|
|
135
|
+
* A record made under other region data comes back with its `region:unknown` count recounted.
|
|
136
|
+
*
|
|
137
|
+
* `acrossBuilds` compares a record from another build's output directory.
|
|
138
|
+
* It leaves out the corpus version, because no row holds it.
|
|
139
|
+
*
|
|
140
|
+
* It also leaves out the builder version: that moves at each release,
|
|
141
|
+
* and the code hash already covers the code.
|
|
115
142
|
*/
|
|
116
143
|
export async function readReusableSource(
|
|
117
144
|
sourceDir: PathBuilderLike,
|
|
118
|
-
expected:
|
|
145
|
+
expected: ExpectedSource,
|
|
146
|
+
opts: { acrossBuilds?: boolean } = {}
|
|
119
147
|
): Promise<{ record: SourceCompletionRecord; problem: null } | { record: null; problem: string }> {
|
|
120
148
|
const path = PathBuilder.from(sourceDir)(SOURCE_RECORD_FILE)
|
|
121
149
|
const record = await tryReadLocalJSONFile<SourceCompletionRecord>(path).catch(() => null)
|
|
122
150
|
|
|
123
151
|
if (!record) return { record: null, problem: `${path.toString()} is absent or unreadable` }
|
|
124
152
|
|
|
125
|
-
|
|
153
|
+
const settingsOf = (settings: SourceBuildSettings): unknown =>
|
|
154
|
+
opts.acrossBuilds ? { ...settings, align: { ...settings.align, corpus_version: null } } : settings
|
|
155
|
+
|
|
156
|
+
const derivationOf = (derivation: DerivationInputs): unknown => {
|
|
157
|
+
const current = withoutRegionCheckInputs(derivation)
|
|
158
|
+
|
|
159
|
+
return opts.acrossBuilds ? { ...current, builderVersion: null } : current
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (canonicalJSON(settingsOf(record.settings)) !== canonicalJSON(settingsOf(expected.settings))) {
|
|
126
163
|
return { record: null, problem: `${path.toString()} was written under other build settings` }
|
|
127
164
|
}
|
|
128
165
|
|
|
129
|
-
if (canonicalJSON(record.derivation) !== canonicalJSON(expected.derivation)) {
|
|
166
|
+
if (canonicalJSON(derivationOf(record.derivation)) !== canonicalJSON(derivationOf(expected.derivation))) {
|
|
130
167
|
return { record: null, problem: `${path.toString()} was written from another input, code or config` }
|
|
131
168
|
}
|
|
132
169
|
|
|
@@ -164,5 +201,5 @@ export async function readReusableSource(
|
|
|
164
201
|
if (problem) return { record: null, problem }
|
|
165
202
|
}
|
|
166
203
|
|
|
167
|
-
return
|
|
204
|
+
return recountRegionCheck(record, expected.regionCheck, expected.readRegions)
|
|
168
205
|
}
|
package/lib/build/types.ts
CHANGED
|
@@ -222,6 +222,22 @@ export interface BuildCorpusOptions {
|
|
|
222
222
|
*/
|
|
223
223
|
freshSources?: readonly string[]
|
|
224
224
|
|
|
225
|
+
/**
|
|
226
|
+
* Input rows per adapter partition when `jobs` is above `1`, for an adapter that declares `inputRowCount`.
|
|
227
|
+
*
|
|
228
|
+
* @defaultValue `PARTITION_ROWS`
|
|
229
|
+
*/
|
|
230
|
+
partitionRows?: number
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Earlier builds' output directories, searched in order for each source a
|
|
234
|
+
* parallel build would otherwise build.
|
|
235
|
+
*
|
|
236
|
+
* A source whose `SOURCE_COMPLETE.json` there matches this build's derivation and settings, apart
|
|
237
|
+
* from the corpus and builder versions, is cloned into this build instead of built (`#build/reuse`).
|
|
238
|
+
*/
|
|
239
|
+
reuseFrom?: readonly PathBuilderLike[]
|
|
240
|
+
|
|
225
241
|
/**
|
|
226
242
|
* Cancels a parallel build: the coordinator stops its workers, keeps every finished
|
|
227
243
|
* source's record for a later `--resume`, releases the output lock and rejects.
|
|
@@ -316,6 +332,16 @@ export interface BuildCorpusManifest {
|
|
|
316
332
|
* provenance may be absent from model provenance, and this field is where the difference reads.
|
|
317
333
|
*/
|
|
318
334
|
refused_rows_by_source: Record<string, number>
|
|
335
|
+
/**
|
|
336
|
+
* Training draws each source's `trainShare` left out, so a reader can tell
|
|
337
|
+
* a capped source from a small one.
|
|
338
|
+
*
|
|
339
|
+
* A draw is a row the share dropped, or an augmentation it kept from running.
|
|
340
|
+
* A skipped augmentation would have written one row or none, so the count is
|
|
341
|
+
* an upper bound on the rows left out.
|
|
342
|
+
* Validation and test rows are never left out.
|
|
343
|
+
*/
|
|
344
|
+
train_rows_left_out_by_source: Record<string, number>
|
|
319
345
|
/**
|
|
320
346
|
* Admitted rows whose license resolves to no SPDX expression.
|
|
321
347
|
* Their obligations are unknown rather than empty.
|