@mailwoman/corpus 11.1.0 → 11.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.
- package/README.md +20 -14
- package/data/address-source-register.json +618 -13
- package/data/builds/v0.8.19-overlay/OVERLAY_PLAN.json +4778 -0
- package/data/builds/v0.8.19-rebuild/inputs.json +128 -0
- package/data/builds/v0.8.20-overlay/OVERLAY_PLAN.json +3595 -0
- package/data/builds/v0.8.20-rebuild/inputs.json +131 -0
- package/data/builds/v0.8.21-overlay/OVERLAY_PLAN.json +72 -0
- package/data/corpus-source-inputs.json +104 -2
- package/data/holdout/evaluation-groups.v0.8.18.json +90511 -0
- package/data/holdout/evaluation-groups.v0.8.19.json +100537 -0
- package/data/holdout/evaluation-groups.v0.8.20.json +129215 -0
- package/data/holdout/evaluation-groups.v0.8.21.json +173286 -0
- package/data/holdout/probe-text-collisions.v0.8.20.json +1478 -0
- package/data/license-decisions.json +393 -3
- package/data/licenses/PROVENANCE.md +15 -9
- package/data/licenses/au-acnc-cc-by-3.0-au.md +37 -0
- package/data/licenses/es-sanidad-aviso-legal.md +26 -0
- package/data/licenses/it-miur-iodl-2.0.md +41 -0
- package/data/licenses/nz-charities-cc-by-3.0-nz.md +36 -0
- package/data/region-slot-second-level.json +966 -0
- package/data/source-additions.json +126 -6
- package/data/source-resolutions.json +97 -0
- package/data/training-configs/v8.7.0-base-c6-90k-usgs-structures-s42.yaml +801 -0
- package/data/training-configs/v8.7.0-base-c6-90k-usgs-structures-s43.yaml +726 -0
- package/data/training-configs/v8.8.0-base-c6-90k-v0820-county-s42.yaml +944 -0
- package/data/training-configs/v8.9.0-base-c6-90k-v0821-s42.yaml +848 -0
- package/data/training-manifests/v0.8.19-retention-overlay.json +4553 -0
- package/data/training-manifests/v0.8.20-retention-overlay.json +4579 -0
- package/data/training-manifests/v0.8.21-retention-overlay.effective.json +2521 -0
- package/data/training-manifests/v0.8.21-retention-overlay.json +4579 -0
- package/lib/adapters/cordis/adapter.ts +10 -2
- package/lib/adapters/gleif/adapter.ts +23 -5
- package/lib/adapters/osm/adapter.ts +2 -2
- package/lib/adapters/street/repetition.ts +87 -0
- package/lib/adapters/street/unit.ts +14 -0
- package/lib/adapters/wof/admin/json/adapter.ts +34 -21
- package/lib/adapters/wof/admin/json/dual-role.ts +274 -0
- package/lib/adapters/wof/admin/json/explore.ts +4 -4
- package/lib/adapters/wof/admin/json/region-codes.ts +74 -3
- package/lib/adapters/wof/json-rows.ts +36 -21
- package/lib/adapters/wof/postalcode-json/adapter.ts +10 -28
- package/lib/adapters/wof/sample.ts +15 -3
- package/lib/adapters/wof/stored-records.ts +162 -0
- package/lib/adapters.ts +18 -6
- package/lib/au/adapters/acnc-register/adapter.ts +40 -0
- package/lib/au/evaluation/acnc-register.ts +144 -0
- package/lib/build/align/range.ts +9 -0
- package/lib/build/align/totals.ts +23 -0
- package/lib/build/align.ts +74 -4
- package/lib/build/budget.ts +11 -45
- package/lib/build/checkpoint.ts +11 -0
- package/lib/build/component-check.ts +99 -3
- package/lib/build/manifest.ts +4 -0
- package/lib/build/parallel.ts +8 -34
- package/lib/build/region-names.ts +609 -0
- package/lib/build/source-record.ts +7 -0
- package/lib/build/types.ts +20 -0
- package/lib/build/worker.ts +3 -1
- package/lib/build.ts +3 -6
- package/lib/de/recipes/locale.ts +3 -2
- package/lib/env.ts +0 -6
- package/lib/es/adapters/sanidad-centros-ap/adapter.ts +40 -0
- package/lib/es/evaluation/sanidad-centros-ap.ts +164 -0
- package/lib/evaluation/corpus-adapter.ts +153 -0
- package/lib/evaluation/source.ts +209 -0
- package/lib/evaluation/sources.ts +25 -0
- package/lib/fr/adapters/laposte-poincont/adapter.ts +381 -0
- package/lib/fr/recipes/unit-line-guideline.ts +9 -4
- package/lib/fr/structures/laposte.ts +139 -0
- package/lib/fr/tools/fetch/laposte-poincont.ts +234 -0
- package/lib/it/adapters/miur-scuole/adapter.ts +39 -0
- package/lib/it/evaluation/miur-scuole.ts +125 -0
- package/lib/jp/adapters/wof-admin/adapter.ts +4 -4
- package/lib/nc/adapters/opt-nc/adapter.ts +237 -0
- package/lib/nc/structures/opt-nc.ts +101 -0
- package/lib/nc/tools/fetch/opt-nc.ts +249 -0
- package/lib/nz/adapters/charities-register/adapter.ts +40 -0
- package/lib/nz/evaluation/charities-register.ts +149 -0
- package/lib/recipes/bare/postcode.ts +14 -11
- package/lib/recipes/deepseek/batches.ts +8 -8
- package/lib/recipes/po/box/cedex/recipe.ts +12 -1
- package/lib/recipes/po/box/cedex/us.ts +43 -2
- package/lib/recipes/scaffold.ts +1 -1
- package/lib/recipes/sources.ts +16 -0
- package/lib/recipes.ts +2 -0
- package/lib/registers.ts +28 -2
- package/lib/{post-offices → structures}/source.ts +49 -16
- package/lib/structures/sources.ts +26 -0
- package/lib/synthesizers/house-venue.ts +11 -6
- package/lib/synthesizers/tail.ts +27 -3
- package/lib/tools/audit.ts +1 -1
- package/lib/tools/fetch/storage.ts +18 -4
- package/lib/tools/fetch.ts +10 -2
- package/lib/tools/overlay/kryptonite.ts +6 -2
- package/lib/tools/overlay/split/attribute.ts +14 -2
- package/lib/tools/overlay/split/overlay.ts +36 -7
- package/lib/tools/postcode/triples.ts +3 -3
- package/lib/tools/region-slot-census.run.ts +184 -0
- package/lib/training/config/load.ts +19 -0
- package/lib/training/config/schema.ts +6 -0
- package/lib/tw/registers.ts +15 -4
- package/lib/tw/structures/chunghwa-post.ts +191 -0
- package/lib/tw/tools/fetch/chunghwa-post.ts +174 -0
- package/lib/us/adapters/state/ny-notaries/adapter.ts +7 -2
- package/lib/us/adapters/state/tx-notaries/adapter.ts +126 -21
- package/lib/us/adapters/usgov/nad/adapter.ts +111 -31
- package/lib/us/adapters/usgov/nppes/adapter.ts +8 -11
- package/lib/us/adapters/usgov/{usgs-post-offices → usgs-structures}/adapter.ts +65 -35
- package/lib/us/recipes/county.ts +474 -0
- package/lib/us/street-unit.ts +15 -5
- package/lib/us/structures/usgs/layers.ts +171 -0
- package/lib/us/structures/usgs/national-map.ts +95 -0
- package/lib/us/tools/fetch/usgs/gnis.ts +288 -0
- package/lib/us/tools/fetch/usgs/structures.ts +362 -0
- package/lib/utils/align.ts +2 -2
- package/lib/utils/evaluation-groups.ts +172 -0
- package/lib/utils/split.ts +40 -4
- package/lib/utils/tokenize.ts +7 -7
- package/lib/utils/validation-groups.ts +292 -0
- package/lib/utils/wof-json.ts +96 -134
- package/out/adapters/cordis/adapter.d.ts +3 -1
- package/out/adapters/cordis/adapter.d.ts.map +1 -1
- package/out/adapters/cordis/adapter.js +8 -2
- package/out/adapters/cordis/adapter.js.map +1 -1
- package/out/adapters/gleif/adapter.d.ts.map +1 -1
- package/out/adapters/gleif/adapter.js +19 -5
- package/out/adapters/gleif/adapter.js.map +1 -1
- package/out/adapters/osm/adapter.js +2 -2
- package/out/adapters/osm/adapter.js.map +1 -1
- package/out/adapters/street/repetition.d.ts +19 -0
- package/out/adapters/street/repetition.d.ts.map +1 -0
- package/out/adapters/street/repetition.js +71 -0
- package/out/adapters/street/repetition.js.map +1 -0
- package/out/adapters/street/unit.d.ts +10 -0
- package/out/adapters/street/unit.d.ts.map +1 -1
- package/out/adapters/street/unit.js +6 -0
- package/out/adapters/street/unit.js.map +1 -1
- package/out/adapters/wof/admin/json/adapter.d.ts +8 -0
- package/out/adapters/wof/admin/json/adapter.d.ts.map +1 -1
- package/out/adapters/wof/admin/json/adapter.js +26 -22
- package/out/adapters/wof/admin/json/adapter.js.map +1 -1
- package/out/adapters/wof/admin/json/dual-role.d.ts +83 -0
- package/out/adapters/wof/admin/json/dual-role.d.ts.map +1 -0
- package/out/adapters/wof/admin/json/dual-role.js +183 -0
- package/out/adapters/wof/admin/json/dual-role.js.map +1 -0
- package/out/adapters/wof/admin/json/explore.d.ts.map +1 -1
- package/out/adapters/wof/admin/json/explore.js +4 -4
- package/out/adapters/wof/admin/json/explore.js.map +1 -1
- package/out/adapters/wof/admin/json/region-codes.d.ts +16 -0
- package/out/adapters/wof/admin/json/region-codes.d.ts.map +1 -1
- package/out/adapters/wof/admin/json/region-codes.js +62 -3
- package/out/adapters/wof/admin/json/region-codes.js.map +1 -1
- package/out/adapters/wof/json-rows.d.ts +28 -6
- package/out/adapters/wof/json-rows.d.ts.map +1 -1
- package/out/adapters/wof/json-rows.js +9 -15
- package/out/adapters/wof/json-rows.js.map +1 -1
- package/out/adapters/wof/postalcode-json/adapter.d.ts +1 -1
- package/out/adapters/wof/postalcode-json/adapter.d.ts.map +1 -1
- package/out/adapters/wof/postalcode-json/adapter.js +9 -26
- package/out/adapters/wof/postalcode-json/adapter.js.map +1 -1
- package/out/adapters/wof/sample.d.ts +8 -1
- package/out/adapters/wof/sample.d.ts.map +1 -1
- package/out/adapters/wof/sample.js +12 -4
- package/out/adapters/wof/sample.js.map +1 -1
- package/out/adapters/wof/stored-records.d.ts +62 -0
- package/out/adapters/wof/stored-records.d.ts.map +1 -0
- package/out/adapters/wof/stored-records.js +91 -0
- package/out/adapters/wof/stored-records.js.map +1 -0
- package/out/adapters.d.ts +1 -1
- package/out/adapters.d.ts.map +1 -1
- package/out/adapters.js +15 -3
- package/out/adapters.js.map +1 -1
- package/out/au/adapters/acnc-register/adapter.d.ts +9 -0
- package/out/au/adapters/acnc-register/adapter.d.ts.map +1 -0
- package/out/au/adapters/acnc-register/adapter.js +37 -0
- package/out/au/adapters/acnc-register/adapter.js.map +1 -0
- package/out/au/evaluation/acnc-register.d.ts +56 -0
- package/out/au/evaluation/acnc-register.d.ts.map +1 -0
- package/out/au/evaluation/acnc-register.js +84 -0
- package/out/au/evaluation/acnc-register.js.map +1 -0
- package/out/build/align/range.d.ts.map +1 -1
- package/out/build/align/range.js +9 -0
- package/out/build/align/range.js.map +1 -1
- package/out/build/align/totals.d.ts +5 -0
- package/out/build/align/totals.d.ts.map +1 -1
- package/out/build/align/totals.js +15 -0
- package/out/build/align/totals.js.map +1 -1
- package/out/build/align.d.ts +26 -0
- package/out/build/align.d.ts.map +1 -1
- package/out/build/align.js +35 -2
- package/out/build/align.js.map +1 -1
- package/out/build/budget.d.ts +9 -26
- package/out/build/budget.d.ts.map +1 -1
- package/out/build/budget.js +10 -31
- package/out/build/budget.js.map +1 -1
- package/out/build/checkpoint.d.ts +11 -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 +55 -1
- package/out/build/component-check.d.ts.map +1 -1
- package/out/build/component-check.js +65 -3
- package/out/build/component-check.js.map +1 -1
- package/out/build/manifest.d.ts.map +1 -1
- package/out/build/manifest.js +4 -0
- package/out/build/manifest.js.map +1 -1
- package/out/build/parallel.d.ts.map +1 -1
- package/out/build/parallel.js +8 -24
- package/out/build/parallel.js.map +1 -1
- package/out/build/region-names.d.ts +120 -0
- package/out/build/region-names.d.ts.map +1 -0
- package/out/build/region-names.js +430 -0
- package/out/build/region-names.js.map +1 -0
- package/out/build/source-record.d.ts.map +1 -1
- package/out/build/source-record.js +4 -0
- package/out/build/source-record.js.map +1 -1
- package/out/build/types.d.ts +20 -0
- package/out/build/types.d.ts.map +1 -1
- package/out/build/worker.js +3 -1
- package/out/build/worker.js.map +1 -1
- package/out/build.d.ts +0 -1
- package/out/build.d.ts.map +1 -1
- package/out/build.js +3 -5
- package/out/build.js.map +1 -1
- package/out/de/recipes/locale.d.ts.map +1 -1
- package/out/de/recipes/locale.js +3 -2
- package/out/de/recipes/locale.js.map +1 -1
- package/out/env.d.ts +0 -2
- package/out/env.d.ts.map +1 -1
- package/out/env.js +0 -5
- package/out/env.js.map +1 -1
- package/out/es/adapters/sanidad-centros-ap/adapter.d.ts +9 -0
- package/out/es/adapters/sanidad-centros-ap/adapter.d.ts.map +1 -0
- package/out/es/adapters/sanidad-centros-ap/adapter.js +36 -0
- package/out/es/adapters/sanidad-centros-ap/adapter.js.map +1 -0
- package/out/es/evaluation/sanidad-centros-ap.d.ts +34 -0
- package/out/es/evaluation/sanidad-centros-ap.d.ts.map +1 -0
- package/out/es/evaluation/sanidad-centros-ap.js +128 -0
- package/out/es/evaluation/sanidad-centros-ap.js.map +1 -0
- package/out/evaluation/corpus-adapter.d.ts +60 -0
- package/out/evaluation/corpus-adapter.d.ts.map +1 -0
- package/out/evaluation/corpus-adapter.js +100 -0
- package/out/evaluation/corpus-adapter.js.map +1 -0
- package/out/evaluation/source.d.ts +134 -0
- package/out/evaluation/source.d.ts.map +1 -0
- package/out/evaluation/source.js +80 -0
- package/out/evaluation/source.js.map +1 -0
- package/out/evaluation/sources.d.ts +6 -0
- package/out/evaluation/sources.d.ts.map +1 -0
- package/out/evaluation/sources.js +22 -0
- package/out/evaluation/sources.js.map +1 -0
- package/out/fr/adapters/laposte-poincont/adapter.d.ts +110 -0
- package/out/fr/adapters/laposte-poincont/adapter.d.ts.map +1 -0
- package/out/fr/adapters/laposte-poincont/adapter.js +315 -0
- package/out/fr/adapters/laposte-poincont/adapter.js.map +1 -0
- package/out/fr/recipes/unit-line-guideline.d.ts.map +1 -1
- package/out/fr/recipes/unit-line-guideline.js +8 -4
- package/out/fr/recipes/unit-line-guideline.js.map +1 -1
- package/out/fr/structures/laposte.d.ts +27 -0
- package/out/fr/structures/laposte.d.ts.map +1 -0
- package/out/fr/structures/laposte.js +96 -0
- package/out/fr/structures/laposte.js.map +1 -0
- package/out/fr/tools/fetch/laposte-poincont.d.ts +95 -0
- package/out/fr/tools/fetch/laposte-poincont.d.ts.map +1 -0
- package/out/fr/tools/fetch/laposte-poincont.js +135 -0
- package/out/fr/tools/fetch/laposte-poincont.js.map +1 -0
- package/out/it/adapters/miur-scuole/adapter.d.ts +9 -0
- package/out/it/adapters/miur-scuole/adapter.d.ts.map +1 -0
- package/out/it/adapters/miur-scuole/adapter.js +35 -0
- package/out/it/adapters/miur-scuole/adapter.js.map +1 -0
- package/out/it/evaluation/miur-scuole.d.ts +53 -0
- package/out/it/evaluation/miur-scuole.d.ts.map +1 -0
- package/out/it/evaluation/miur-scuole.js +68 -0
- package/out/it/evaluation/miur-scuole.js.map +1 -0
- package/out/jp/adapters/wof-admin/adapter.js +4 -4
- package/out/nc/adapters/opt-nc/adapter.d.ts +84 -0
- package/out/nc/adapters/opt-nc/adapter.d.ts.map +1 -0
- package/out/nc/adapters/opt-nc/adapter.js +173 -0
- package/out/nc/adapters/opt-nc/adapter.js.map +1 -0
- package/out/nc/structures/opt-nc.d.ts +12 -0
- package/out/nc/structures/opt-nc.d.ts.map +1 -0
- package/out/nc/structures/opt-nc.js +64 -0
- package/out/nc/structures/opt-nc.js.map +1 -0
- package/out/nc/tools/fetch/opt-nc.d.ts +81 -0
- package/out/nc/tools/fetch/opt-nc.d.ts.map +1 -0
- package/out/nc/tools/fetch/opt-nc.js +162 -0
- package/out/nc/tools/fetch/opt-nc.js.map +1 -0
- package/out/nz/adapters/charities-register/adapter.d.ts +9 -0
- package/out/nz/adapters/charities-register/adapter.d.ts.map +1 -0
- package/out/nz/adapters/charities-register/adapter.js +36 -0
- package/out/nz/adapters/charities-register/adapter.js.map +1 -0
- package/out/nz/evaluation/charities-register.d.ts +60 -0
- package/out/nz/evaluation/charities-register.d.ts.map +1 -0
- package/out/nz/evaluation/charities-register.js +84 -0
- package/out/nz/evaluation/charities-register.js.map +1 -0
- package/out/recipes/bare/postcode.d.ts +2 -1
- package/out/recipes/bare/postcode.d.ts.map +1 -1
- package/out/recipes/bare/postcode.js +14 -11
- package/out/recipes/bare/postcode.js.map +1 -1
- package/out/recipes/deepseek/batches.d.ts +11 -1
- package/out/recipes/deepseek/batches.d.ts.map +1 -1
- package/out/recipes/deepseek/batches.js +8 -7
- package/out/recipes/deepseek/batches.js.map +1 -1
- package/out/recipes/po/box/cedex/recipe.d.ts.map +1 -1
- package/out/recipes/po/box/cedex/recipe.js +12 -1
- package/out/recipes/po/box/cedex/recipe.js.map +1 -1
- package/out/recipes/po/box/cedex/us.d.ts +12 -0
- package/out/recipes/po/box/cedex/us.d.ts.map +1 -1
- package/out/recipes/po/box/cedex/us.js +36 -2
- package/out/recipes/po/box/cedex/us.js.map +1 -1
- package/out/recipes/scaffold.d.ts +1 -1
- package/out/recipes/sources.d.ts.map +1 -1
- package/out/recipes/sources.js +16 -0
- package/out/recipes/sources.js.map +1 -1
- package/out/recipes.d.ts.map +1 -1
- package/out/recipes.js +2 -0
- package/out/recipes.js.map +1 -1
- package/out/registers.d.ts +28 -2
- package/out/registers.d.ts.map +1 -1
- package/out/registers.js +28 -2
- package/out/registers.js.map +1 -1
- package/out/{post-offices → structures}/source.d.ts +34 -16
- package/out/structures/source.d.ts.map +1 -0
- package/out/structures/source.js +39 -0
- package/out/structures/source.js.map +1 -0
- package/out/structures/sources.d.ts +6 -0
- package/out/structures/sources.d.ts.map +1 -0
- package/out/structures/sources.js +23 -0
- package/out/structures/sources.js.map +1 -0
- package/out/synthesizers/house-venue.d.ts.map +1 -1
- package/out/synthesizers/house-venue.js +2 -1
- package/out/synthesizers/house-venue.js.map +1 -1
- package/out/synthesizers/tail.d.ts +15 -1
- package/out/synthesizers/tail.d.ts.map +1 -1
- package/out/synthesizers/tail.js +8 -3
- package/out/synthesizers/tail.js.map +1 -1
- package/out/tools/audit.js +1 -1
- package/out/tools/audit.js.map +1 -1
- package/out/tools/fetch/storage.d.ts +10 -2
- package/out/tools/fetch/storage.d.ts.map +1 -1
- package/out/tools/fetch/storage.js +18 -4
- package/out/tools/fetch/storage.js.map +1 -1
- package/out/tools/fetch.d.ts +10 -2
- package/out/tools/fetch.d.ts.map +1 -1
- package/out/tools/fetch.js +10 -2
- package/out/tools/fetch.js.map +1 -1
- package/out/tools/overlay/kryptonite.d.ts.map +1 -1
- package/out/tools/overlay/kryptonite.js +5 -2
- package/out/tools/overlay/kryptonite.js.map +1 -1
- package/out/tools/overlay/split/attribute.d.ts +7 -1
- package/out/tools/overlay/split/attribute.d.ts.map +1 -1
- package/out/tools/overlay/split/attribute.js +4 -1
- package/out/tools/overlay/split/attribute.js.map +1 -1
- package/out/tools/overlay/split/overlay.d.ts +10 -0
- package/out/tools/overlay/split/overlay.d.ts.map +1 -1
- package/out/tools/overlay/split/overlay.js +17 -4
- package/out/tools/overlay/split/overlay.js.map +1 -1
- package/out/tools/postcode/triples.js +3 -3
- package/out/tools/postcode/triples.js.map +1 -1
- package/out/tools/region-slot-census.run.d.ts +2 -0
- package/out/tools/region-slot-census.run.d.ts.map +1 -0
- package/out/tools/region-slot-census.run.js +134 -0
- package/out/tools/region-slot-census.run.js.map +1 -0
- package/out/training/config/load.d.ts.map +1 -1
- package/out/training/config/load.js +10 -0
- package/out/training/config/load.js.map +1 -1
- package/out/training/config/schema.d.ts +13 -0
- package/out/training/config/schema.d.ts.map +1 -1
- package/out/training/config/schema.js +6 -0
- package/out/training/config/schema.js.map +1 -1
- package/out/tw/registers.d.ts +9 -0
- package/out/tw/registers.d.ts.map +1 -1
- package/out/tw/registers.js +11 -4
- package/out/tw/registers.js.map +1 -1
- package/out/tw/structures/chunghwa-post.d.ts +39 -0
- package/out/tw/structures/chunghwa-post.d.ts.map +1 -0
- package/out/tw/structures/chunghwa-post.js +150 -0
- package/out/tw/structures/chunghwa-post.js.map +1 -0
- package/out/tw/tools/fetch/chunghwa-post.d.ts +55 -0
- package/out/tw/tools/fetch/chunghwa-post.d.ts.map +1 -0
- package/out/tw/tools/fetch/chunghwa-post.js +110 -0
- package/out/tw/tools/fetch/chunghwa-post.js.map +1 -0
- package/out/us/adapters/state/ny-notaries/adapter.d.ts.map +1 -1
- package/out/us/adapters/state/ny-notaries/adapter.js +7 -2
- package/out/us/adapters/state/ny-notaries/adapter.js.map +1 -1
- package/out/us/adapters/state/tx-notaries/adapter.d.ts +42 -0
- package/out/us/adapters/state/tx-notaries/adapter.d.ts.map +1 -1
- package/out/us/adapters/state/tx-notaries/adapter.js +92 -19
- package/out/us/adapters/state/tx-notaries/adapter.js.map +1 -1
- package/out/us/adapters/usgov/nad/adapter.d.ts +35 -2
- package/out/us/adapters/usgov/nad/adapter.d.ts.map +1 -1
- package/out/us/adapters/usgov/nad/adapter.js +90 -27
- package/out/us/adapters/usgov/nad/adapter.js.map +1 -1
- package/out/us/adapters/usgov/nppes/adapter.d.ts.map +1 -1
- package/out/us/adapters/usgov/nppes/adapter.js +8 -11
- package/out/us/adapters/usgov/nppes/adapter.js.map +1 -1
- package/out/us/adapters/usgov/usgs-structures/adapter.d.ts +87 -0
- package/out/us/adapters/usgov/usgs-structures/adapter.d.ts.map +1 -0
- package/out/us/adapters/usgov/{usgs-post-offices → usgs-structures}/adapter.js +36 -27
- package/out/us/adapters/usgov/usgs-structures/adapter.js.map +1 -0
- package/out/us/recipes/county.d.ts +124 -0
- package/out/us/recipes/county.d.ts.map +1 -0
- package/out/us/recipes/county.js +295 -0
- package/out/us/recipes/county.js.map +1 -0
- package/out/us/street-unit.d.ts +10 -3
- package/out/us/street-unit.d.ts.map +1 -1
- package/out/us/street-unit.js +14 -6
- package/out/us/street-unit.js.map +1 -1
- package/out/us/structures/usgs/layers.d.ts +57 -0
- package/out/us/structures/usgs/layers.d.ts.map +1 -0
- package/out/us/structures/usgs/layers.js +121 -0
- package/out/us/structures/usgs/layers.js.map +1 -0
- package/out/us/structures/usgs/national-map.d.ts +14 -0
- package/out/us/structures/usgs/national-map.d.ts.map +1 -0
- package/out/us/{post-offices/usgs-national-map.js → structures/usgs/national-map.js} +16 -14
- package/out/us/structures/usgs/national-map.js.map +1 -0
- package/out/us/tools/fetch/usgs/gnis.d.ts +118 -0
- package/out/us/tools/fetch/usgs/gnis.d.ts.map +1 -0
- package/out/us/tools/fetch/usgs/gnis.js +177 -0
- package/out/us/tools/fetch/usgs/gnis.js.map +1 -0
- package/out/us/tools/fetch/usgs/structures.d.ts +99 -0
- package/out/us/tools/fetch/usgs/structures.d.ts.map +1 -0
- package/out/us/tools/fetch/usgs/structures.js +233 -0
- package/out/us/tools/fetch/usgs/structures.js.map +1 -0
- package/out/utils/align.js.map +1 -1
- package/out/utils/evaluation-groups.d.ts +98 -0
- package/out/utils/evaluation-groups.d.ts.map +1 -0
- package/out/utils/evaluation-groups.js +92 -0
- package/out/utils/evaluation-groups.js.map +1 -0
- package/out/utils/split.d.ts +26 -1
- package/out/utils/split.d.ts.map +1 -1
- package/out/utils/split.js +28 -3
- package/out/utils/split.js.map +1 -1
- package/out/utils/tokenize.d.ts +3 -3
- package/out/utils/tokenize.d.ts.map +1 -1
- package/out/utils/tokenize.js.map +1 -1
- package/out/utils/validation-groups.d.ts +168 -0
- package/out/utils/validation-groups.d.ts.map +1 -0
- package/out/utils/validation-groups.js +135 -0
- package/out/utils/validation-groups.js.map +1 -0
- package/out/utils/wof-json.d.ts +31 -57
- package/out/utils/wof-json.d.ts.map +1 -1
- package/out/utils/wof-json.js +81 -98
- package/out/utils/wof-json.js.map +1 -1
- package/package.json +18 -18
- package/lib/adapters/wof/record-cache.ts +0 -118
- package/lib/build/heap.ts +0 -60
- package/lib/post-offices/sources.ts +0 -18
- package/lib/us/post-offices/usgs-national-map.ts +0 -89
- package/lib/us/tools/fetch/usgs-post-offices.ts +0 -362
- package/out/adapters/wof/record-cache.d.ts +0 -22
- package/out/adapters/wof/record-cache.d.ts.map +0 -1
- package/out/adapters/wof/record-cache.js +0 -89
- package/out/adapters/wof/record-cache.js.map +0 -1
- package/out/build/heap.d.ts +0 -26
- package/out/build/heap.d.ts.map +0 -1
- package/out/build/heap.js +0 -52
- package/out/build/heap.js.map +0 -1
- package/out/post-offices/source.d.ts.map +0 -1
- package/out/post-offices/source.js +0 -21
- package/out/post-offices/source.js.map +0 -1
- package/out/post-offices/sources.d.ts +0 -13
- package/out/post-offices/sources.d.ts.map +0 -1
- package/out/post-offices/sources.js +0 -8
- package/out/post-offices/sources.js.map +0 -1
- package/out/us/adapters/usgov/usgs-post-offices/adapter.d.ts +0 -66
- package/out/us/adapters/usgov/usgs-post-offices/adapter.d.ts.map +0 -1
- package/out/us/adapters/usgov/usgs-post-offices/adapter.js.map +0 -1
- package/out/us/post-offices/usgs-national-map.d.ts +0 -14
- package/out/us/post-offices/usgs-national-map.d.ts.map +0 -1
- package/out/us/post-offices/usgs-national-map.js.map +0 -1
- package/out/us/tools/fetch/usgs-post-offices.d.ts +0 -99
- package/out/us/tools/fetch/usgs-post-offices.d.ts.map +0 -1
- package/out/us/tools/fetch/usgs-post-offices.js +0 -246
- package/out/us/tools/fetch/usgs-post-offices.js.map +0 -1
package/out/build/budget.d.ts
CHANGED
|
@@ -20,12 +20,12 @@ export interface WorkerResources {
|
|
|
20
20
|
duckdbThreads: number;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* The
|
|
23
|
+
* The worker classes.
|
|
24
24
|
*
|
|
25
|
-
* `standard` runs every task
|
|
26
|
-
*
|
|
27
|
-
* `
|
|
28
|
-
*
|
|
25
|
+
* `standard` runs every task: an adapter, an align range, or a source's sort and parquet write.
|
|
26
|
+
* The WOF adapters read the WOF record store and peaked at 1,862 MiB
|
|
27
|
+
* (`wof-admin`, 79,116,868 rows) and 636 MiB (`wof-postalcode`, 5,240,681 rows) by
|
|
28
|
+
* kernel `maxRSS` over the lab's full clone set, inside the standard heap.
|
|
29
29
|
*/
|
|
30
30
|
export declare const WORKER_CLASSES: {
|
|
31
31
|
readonly standard: {
|
|
@@ -33,11 +33,6 @@ export declare const WORKER_CLASSES: {
|
|
|
33
33
|
readonly duckdbBytes: number;
|
|
34
34
|
readonly duckdbThreads: 1;
|
|
35
35
|
};
|
|
36
|
-
readonly resident: {
|
|
37
|
-
readonly heapBytes: number;
|
|
38
|
-
readonly duckdbBytes: 0;
|
|
39
|
-
readonly duckdbThreads: 1;
|
|
40
|
-
};
|
|
41
36
|
};
|
|
42
37
|
export type WorkerClass = keyof typeof WORKER_CLASSES;
|
|
43
38
|
/**
|
|
@@ -54,10 +49,6 @@ export declare const HOST_RESERVE_BYTES: number;
|
|
|
54
49
|
* Bytes one worker of `workerClass` reserves while it runs.
|
|
55
50
|
*/
|
|
56
51
|
export declare function workerReservationBytes(workerClass: WorkerClass): number;
|
|
57
|
-
/**
|
|
58
|
-
* The class a source's adapter task runs in.
|
|
59
|
-
*/
|
|
60
|
-
export declare function adapterWorkerClass(adapterID: string): WorkerClass;
|
|
61
52
|
/**
|
|
62
53
|
* A parallel build's memory plan.
|
|
63
54
|
*/
|
|
@@ -70,27 +61,19 @@ export interface WorkerBudget {
|
|
|
70
61
|
* The `--jobs` a build takes when none is given: the most standard workers the
|
|
71
62
|
* host's budget holds, capped at the host's CPU count.
|
|
72
63
|
*
|
|
73
|
-
* Returns 1 for a serial build when fewer than two workers fit
|
|
74
|
-
* adapter cannot fit in the budget. {@linkcode planWorkerBudget} refuses that configuration.
|
|
64
|
+
* Returns 1 for a serial build when fewer than two workers fit.
|
|
75
65
|
*/
|
|
76
|
-
export declare function defaultBuildJobs(opts
|
|
77
|
-
adapterIDs: readonly string[];
|
|
66
|
+
export declare function defaultBuildJobs(opts?: {
|
|
78
67
|
hostMemoryBytes?: number;
|
|
79
68
|
}): number;
|
|
80
69
|
/**
|
|
81
|
-
* Check that `jobs` standard workers fit in the host budget
|
|
82
|
-
* adapter fits when it runs by itself.
|
|
83
|
-
*
|
|
84
|
-
* A resident adapter runs one at a time and beside the standard workers that fit,
|
|
85
|
-
* so it lowers the build's concurrency while it runs rather than raising its demand.
|
|
70
|
+
* Check that `jobs` standard workers fit in the host budget.
|
|
86
71
|
*
|
|
87
|
-
* @throws When `jobs` standard workers exceed the budget
|
|
88
|
-
* adapter exceeds the budget when it runs by itself.
|
|
72
|
+
* @throws When `jobs` standard workers exceed the budget.
|
|
89
73
|
* The error lists each reservation and the largest `--jobs` that fits.
|
|
90
74
|
*/
|
|
91
75
|
export declare function planWorkerBudget(opts: {
|
|
92
76
|
jobs: number;
|
|
93
|
-
adapterIDs: readonly string[];
|
|
94
77
|
hostMemoryBytes?: number;
|
|
95
78
|
}): WorkerBudget;
|
|
96
79
|
//# sourceMappingURL=budget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"budget.d.ts","sourceRoot":"","sources":["../../lib/build/budget.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"budget.d.ts","sourceRoot":"","sources":["../../lib/build/budget.ts"],"names":[],"mappings":"AAoBA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,CAAA;CACrB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc;;iBACd,SAAS;iBAAW,WAAW;iBAAa,aAAa,EAAE,CAAC;;CACrB,CAAA;AAEpD,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,cAAc,CAAA;AAErD;;GAEG;AACH,eAAO,MAAM,6BAA6B,QAAY,CAAA;AAEtD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,QAAY,CAAA;AAE3C;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAIvE;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,eAAe,EAAE,MAAM,CAAA;IACvB,WAAW,EAAE,MAAM,CAAA;CACnB;AAID;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAE;IAAE,eAAe,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,MAAM,CAMhF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAmB/F"}
|
package/out/build/budget.js
CHANGED
|
@@ -13,19 +13,17 @@
|
|
|
13
13
|
* adapter phase, 0.48 GiB in align and 4.39 GiB in the parquet phase of a serial build holding every source.
|
|
14
14
|
*/
|
|
15
15
|
import { availableParallelism, totalMemoryBytes } from "@mailwoman/core/utils/system";
|
|
16
|
-
import { isResidentRecordAdapter } from "#build/heap";
|
|
17
16
|
const GiB = 1024 ** 3;
|
|
18
17
|
/**
|
|
19
|
-
* The
|
|
18
|
+
* The worker classes.
|
|
20
19
|
*
|
|
21
|
-
* `standard` runs every task
|
|
22
|
-
*
|
|
23
|
-
* `
|
|
24
|
-
*
|
|
20
|
+
* `standard` runs every task: an adapter, an align range, or a source's sort and parquet write.
|
|
21
|
+
* The WOF adapters read the WOF record store and peaked at 1,862 MiB
|
|
22
|
+
* (`wof-admin`, 79,116,868 rows) and 636 MiB (`wof-postalcode`, 5,240,681 rows) by
|
|
23
|
+
* kernel `maxRSS` over the lab's full clone set, inside the standard heap.
|
|
25
24
|
*/
|
|
26
25
|
export const WORKER_CLASSES = {
|
|
27
26
|
standard: { heapBytes: 6 * GiB, duckdbBytes: 1.5 * GiB, duckdbThreads: 1 },
|
|
28
|
-
resident: { heapBytes: 16 * GiB, duckdbBytes: 0, duckdbThreads: 1 },
|
|
29
27
|
};
|
|
30
28
|
/**
|
|
31
29
|
* Native memory a worker holds outside its heap and DuckDB: stream buffers, the module graph, `sort` pipes.
|
|
@@ -44,36 +42,23 @@ export function workerReservationBytes(workerClass) {
|
|
|
44
42
|
const resources = WORKER_CLASSES[workerClass];
|
|
45
43
|
return resources.heapBytes + resources.duckdbBytes + WORKER_NATIVE_ALLOWANCE_BYTES;
|
|
46
44
|
}
|
|
47
|
-
/**
|
|
48
|
-
* The class a source's adapter task runs in.
|
|
49
|
-
*/
|
|
50
|
-
export function adapterWorkerClass(adapterID) {
|
|
51
|
-
return isResidentRecordAdapter(adapterID) ? "resident" : "standard";
|
|
52
|
-
}
|
|
53
45
|
const gib = (bytes) => `${(bytes / GiB).toFixed(1)} GiB`;
|
|
54
46
|
/**
|
|
55
47
|
* The `--jobs` a build takes when none is given: the most standard workers the
|
|
56
48
|
* host's budget holds, capped at the host's CPU count.
|
|
57
49
|
*
|
|
58
|
-
* Returns 1 for a serial build when fewer than two workers fit
|
|
59
|
-
* adapter cannot fit in the budget. {@linkcode planWorkerBudget} refuses that configuration.
|
|
50
|
+
* Returns 1 for a serial build when fewer than two workers fit.
|
|
60
51
|
*/
|
|
61
|
-
export function defaultBuildJobs(opts) {
|
|
52
|
+
export function defaultBuildJobs(opts = {}) {
|
|
62
53
|
const hostMemoryBytes = opts.hostMemoryBytes ?? totalMemoryBytes();
|
|
63
54
|
const budgetBytes = hostMemoryBytes - HOST_RESERVE_BYTES;
|
|
64
|
-
const residentFits = !opts.adapterIDs.some(isResidentRecordAdapter) || workerReservationBytes("resident") <= budgetBytes;
|
|
65
55
|
const fits = Math.min(availableParallelism(), Math.floor(budgetBytes / workerReservationBytes("standard")));
|
|
66
|
-
return
|
|
56
|
+
return fits >= 2 ? fits : 1;
|
|
67
57
|
}
|
|
68
58
|
/**
|
|
69
|
-
* Check that `jobs` standard workers fit in the host budget
|
|
70
|
-
* adapter fits when it runs by itself.
|
|
59
|
+
* Check that `jobs` standard workers fit in the host budget.
|
|
71
60
|
*
|
|
72
|
-
*
|
|
73
|
-
* so it lowers the build's concurrency while it runs rather than raising its demand.
|
|
74
|
-
*
|
|
75
|
-
* @throws When `jobs` standard workers exceed the budget, or a configured resident
|
|
76
|
-
* adapter exceeds the budget when it runs by itself.
|
|
61
|
+
* @throws When `jobs` standard workers exceed the budget.
|
|
77
62
|
* The error lists each reservation and the largest `--jobs` that fits.
|
|
78
63
|
*/
|
|
79
64
|
export function planWorkerBudget(opts) {
|
|
@@ -88,12 +73,6 @@ export function planWorkerBudget(opts) {
|
|
|
88
73
|
throw new Error(`corpus build refused: --jobs ${opts.jobs} needs ${gib(opts.jobs * standard)} and ${sizes}. ` +
|
|
89
74
|
(fits >= 1 ? `--jobs ${fits} fits.` : "No parallel build fits this host; run with --jobs 1."));
|
|
90
75
|
}
|
|
91
|
-
const resident = opts.adapterIDs.filter(isResidentRecordAdapter);
|
|
92
|
-
if (resident.length && workerReservationBytes("resident") > budgetBytes) {
|
|
93
|
-
throw new Error(`corpus build refused: ${resident.join(", ")} ${resident.length === 1 ? "runs" : "run"} in a worker reserving ` +
|
|
94
|
-
`${gib(workerReservationBytes("resident"))} (heap ${gib(WORKER_CLASSES.resident.heapBytes)}), and ${sizes}. ` +
|
|
95
|
-
`Run with --jobs 1 on a host that can hold it, or leave ${resident.join(", ")} out of --inputs.`);
|
|
96
|
-
}
|
|
97
76
|
return { jobs: opts.jobs, hostMemoryBytes, budgetBytes };
|
|
98
77
|
}
|
|
99
78
|
//# sourceMappingURL=budget.js.map
|
package/out/build/budget.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"budget.js","sourceRoot":"","sources":["../../lib/build/budget.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAErF,
|
|
1
|
+
{"version":3,"file":"budget.js","sourceRoot":"","sources":["../../lib/build/budget.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAErF,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,CAAA;AAwBrB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,GAAG,GAAG,EAAE,WAAW,EAAE,GAAG,GAAG,GAAG,EAAE,aAAa,EAAE,CAAC,EAAE;CACvB,CAAA;AAIpD;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,GAAG,GAAG,CAAA;AAEtD;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,GAAG,GAAG,CAAA;AAE3C;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,WAAwB;IAC9D,MAAM,SAAS,GAAG,cAAc,CAAC,WAAW,CAAC,CAAA;IAE7C,OAAO,SAAS,CAAC,SAAS,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,wBAAwB,GAAG,CAAC,kBAAkB,CAAC,cAAc,GAAG,CAAC,WAAW,CAAC,EAAE,CAAA;IAEzH,IAAI,IAAI,CAAC,IAAI,GAAG,QAAQ,GAAG,WAAW,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CACd,gCAAgC,IAAI,CAAC,IAAI,UAAU,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,QAAQ,KAAK,IAAI;YAC5F,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,IAAI,QAAQ,CAAC,CAAC,CAAC,sDAAsD,CAAC,CAC9F,CAAA;IACF,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,CAAA;AACzD,CAAC"}
|
|
@@ -64,6 +64,17 @@ export interface AlignCheckpoint {
|
|
|
64
64
|
rows: number;
|
|
65
65
|
license: string;
|
|
66
66
|
}>;
|
|
67
|
+
/**
|
|
68
|
+
* Base rows failing each component rule, per source then rule.
|
|
69
|
+
*
|
|
70
|
+
* Absent from a checkpoint written before the counts existed.
|
|
71
|
+
* A resume refuses such a checkpoint.
|
|
72
|
+
*/
|
|
73
|
+
component_findings_by_source?: Record<string, Record<string, number>>;
|
|
74
|
+
/**
|
|
75
|
+
* The component rules the aligned adapters' rows weren't checked against.
|
|
76
|
+
*/
|
|
77
|
+
unchecked_component_rules?: string[];
|
|
67
78
|
written_at: string;
|
|
68
79
|
}
|
|
69
80
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkpoint.d.ts","sourceRoot":"","sources":["../../lib/build/checkpoint.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C;;GAEG;AACH,eAAO,MAAM,aAAa,YAAI,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,CAAU,CAAA;AAE5E,MAAM,MAAM,eAAe,GAAG,C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IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACd,mBAAmB,IAAI,CAAC,QAAQ,EAAE,sBAAsB,KAAK,8BAA8B,MAAM,IAAI;YACpG,oGAAoG;YACpG,uBAAuB,CACxB,CAAA;IACF,CAAC;IAED,MAAM,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IAEnF,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CACd,mBAAmB,IAAI,CAAC,QAAQ,EAAE,aAAa,aAAa,CAAC,UAAU,CAAC,kBAAkB,CAAC,cAAc;YACxG,yCAAyC,aAAa,CAAC,MAAM,CAAC,yCAAyC;YACvG,+DAA+D,CAChE,CAAA;IACF,CAAC;IAED,OAAO,UAAU,CAAA;AAClB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAqB,EAAE,UAA2B;IACtF,OAAO,kBAAkB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;AAClE,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { UnitSplitter } from "#adapters/street/unit";
|
|
2
|
+
import type { RegionNames } from "#build/region-names";
|
|
1
3
|
import type { CanonicalRow } from "#types";
|
|
2
4
|
/**
|
|
3
5
|
* The rules a component value can fail, as the `<tag>:<rule>` tail of a `component-invalid` reason.
|
|
@@ -20,6 +22,25 @@ export declare const ComponentRule: {
|
|
|
20
22
|
* the city with the street line.
|
|
21
23
|
*/
|
|
22
24
|
readonly LocalityHoldsStreet: "locality:holds-street";
|
|
25
|
+
/**
|
|
26
|
+
* The postcode is the row's own region (`1811 Hayes Avenue, Hull, IA IA`).
|
|
27
|
+
*/
|
|
28
|
+
readonly PostcodeRepeatsRegion: "postcode:repeats-region";
|
|
29
|
+
/**
|
|
30
|
+
* The locality is the code the row's country writes for the row's own region
|
|
31
|
+
* (`BELLVILLE, TX, TX 77418` read with `TX` as the city).
|
|
32
|
+
*/
|
|
33
|
+
readonly LocalityRepeatsRegion: "locality:repeats-region";
|
|
34
|
+
/**
|
|
35
|
+
* The street still ends in a unit designator and identifier of the row's
|
|
36
|
+
* country (`Avenue des Armieres Entree 13`).
|
|
37
|
+
*/
|
|
38
|
+
readonly StreetTrailingUnit: "street:trailing-unit";
|
|
39
|
+
/**
|
|
40
|
+
* The region is no name or abbreviation of a region or macroregion of the row's country
|
|
41
|
+
* in the WOF admin database, in a country where that database holds regions.
|
|
42
|
+
*/
|
|
43
|
+
readonly RegionUnknown: "region:unknown";
|
|
23
44
|
};
|
|
24
45
|
export type ComponentRule = (typeof ComponentRule)[keyof typeof ComponentRule];
|
|
25
46
|
/**
|
|
@@ -29,6 +50,16 @@ export type ComponentRule = (typeof ComponentRule)[keyof typeof ComponentRule];
|
|
|
29
50
|
* The v0.8.9 dry run (#2898) found 522,089 rows failing it, among them legitimate partial
|
|
30
51
|
* postcodes (WOF's Dutch `3704`) and spaced written forms (`31 261` in Kraków), beside the defects
|
|
31
52
|
* it is meant for (NAD's 425,667 short ZIP Codes and Overture Brazil's dropped leading zeros).
|
|
53
|
+
*
|
|
54
|
+
* `locality:repeats-region` is reported but not enforced, because a publisher's own `NY` for
|
|
55
|
+
* New York City (`150 E 71 ST, NY, NY 10021`) fails it beside the rows whose city was lost.
|
|
56
|
+
*
|
|
57
|
+
* `street:trailing-unit` is reported but not enforced, because some streets end in a
|
|
58
|
+
* word a country also writes as a unit (`Morning Side`, `Skijor Steppe Upper`).
|
|
59
|
+
*
|
|
60
|
+
* `region:unknown` is reported but not enforced, because neither source holds every
|
|
61
|
+
* form addresses write: Swiss canton codes (`TG`), Latvia's post-2021 municipalities
|
|
62
|
+
* (`Valmieras nov.`), Bangkok's short `กรุงเทพ`.
|
|
32
63
|
*/
|
|
33
64
|
export declare const ENFORCED_COMPONENT_RULES: ReadonlySet<ComponentRule>;
|
|
34
65
|
/**
|
|
@@ -38,8 +69,31 @@ export interface ComponentFinding {
|
|
|
38
69
|
rule: ComponentRule;
|
|
39
70
|
values: string[];
|
|
40
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Rows failing each rule, per `source` then rule.
|
|
74
|
+
*/
|
|
75
|
+
export type ComponentFindingCounts = Map<string, Map<ComponentRule, number>>;
|
|
76
|
+
/**
|
|
77
|
+
* {@linkcode ComponentFindingCounts} as a JSON object, in the order each source and rule was first counted.
|
|
78
|
+
*/
|
|
79
|
+
export declare function componentFindingsRecord(counts: ComponentFindingCounts): Record<string, Record<string, number>>;
|
|
80
|
+
/**
|
|
81
|
+
* What the rules read beyond the row.
|
|
82
|
+
*/
|
|
83
|
+
export interface ComponentCheckContext {
|
|
84
|
+
/**
|
|
85
|
+
* The unit vocabulary `street:trailing-unit` reads.
|
|
86
|
+
* Without it the rule isn't checked.
|
|
87
|
+
*/
|
|
88
|
+
units?: UnitSplitter | null;
|
|
89
|
+
/**
|
|
90
|
+
* The WOF region names `region:unknown` reads.
|
|
91
|
+
* Without them the rule isn't checked.
|
|
92
|
+
*/
|
|
93
|
+
regions?: RegionNames | null;
|
|
94
|
+
}
|
|
41
95
|
/**
|
|
42
96
|
* The rules `components` fails for a row of `country`, in rule order.
|
|
43
97
|
*/
|
|
44
|
-
export declare function componentFindings(components: CanonicalRow["components"], country: string): ComponentFinding[];
|
|
98
|
+
export declare function componentFindings(components: CanonicalRow["components"], country: string, context?: ComponentCheckContext): ComponentFinding[];
|
|
45
99
|
//# sourceMappingURL=component-check.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-check.d.ts","sourceRoot":"","sources":["../../lib/build/component-check.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE1C;;GAEG;AACH,eAAO,MAAM,aAAa;IACzB;;OAEG;aACH,cAAc,EAAE,iBAAiB;IACjC;;OAEG;aACH,qBAAqB,EAAE,yBAAyB;IAChD;;OAEG;aACH,gBAAgB,EAAE,oBAAoB;IACtC;;;OAGG;aACH,mBAAmB,EAAE,uBAAuB;
|
|
1
|
+
{"version":3,"file":"component-check.d.ts","sourceRoot":"","sources":["../../lib/build/component-check.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE1C;;GAEG;AACH,eAAO,MAAM,aAAa;IACzB;;OAEG;aACH,cAAc,EAAE,iBAAiB;IACjC;;OAEG;aACH,qBAAqB,EAAE,yBAAyB;IAChD;;OAEG;aACH,gBAAgB,EAAE,oBAAoB;IACtC;;;OAGG;aACH,mBAAmB,EAAE,uBAAuB;IAC5C;;OAEG;aACH,qBAAqB,EAAE,yBAAyB;IAChD;;;OAGG;aACH,qBAAqB,EAAE,yBAAyB;IAChD;;;OAGG;aACH,kBAAkB,EAAE,sBAAsB;IAC1C;;;OAGG;aACH,aAAa,EAAE,gBAAgB;CACtB,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAA;AAE9E;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,wBAAwB,EAAE,WAAW,CAAC,aAAa,CAK9D,CAAA;AAEF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,aAAa,CAAA;IACnB,MAAM,EAAE,MAAM,EAAE,CAAA;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAA;AAE5E;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAE9G;AAcD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;OAGG;IACH,KAAK,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CAC5B;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAChC,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC,EACtC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,qBAA0B,GACjC,gBAAgB,EAAE,CA6EpB"}
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* street that ends in the row's own postcode (`655 MAPLE AVE # 90014, LOS ANGELES, CA 900142211`). Every rule reads
|
|
9
9
|
* per-country data or the row itself, so the same rules hold in every country.
|
|
10
10
|
*/
|
|
11
|
-
import { acceptPostcode,
|
|
11
|
+
import { acceptPostcode, statesPostcodeSyntax } from "@mailwoman/postcode/country-formats";
|
|
12
|
+
import { writtenSubdivisionCode } from "#adapters/wof/admin/json/region-codes";
|
|
12
13
|
/**
|
|
13
14
|
* The rules a component value can fail, as the `<tag>:<rule>` tail of a `component-invalid` reason.
|
|
14
15
|
*/
|
|
@@ -30,6 +31,25 @@ export const ComponentRule = {
|
|
|
30
31
|
* the city with the street line.
|
|
31
32
|
*/
|
|
32
33
|
LocalityHoldsStreet: "locality:holds-street",
|
|
34
|
+
/**
|
|
35
|
+
* The postcode is the row's own region (`1811 Hayes Avenue, Hull, IA IA`).
|
|
36
|
+
*/
|
|
37
|
+
PostcodeRepeatsRegion: "postcode:repeats-region",
|
|
38
|
+
/**
|
|
39
|
+
* The locality is the code the row's country writes for the row's own region
|
|
40
|
+
* (`BELLVILLE, TX, TX 77418` read with `TX` as the city).
|
|
41
|
+
*/
|
|
42
|
+
LocalityRepeatsRegion: "locality:repeats-region",
|
|
43
|
+
/**
|
|
44
|
+
* The street still ends in a unit designator and identifier of the row's
|
|
45
|
+
* country (`Avenue des Armieres Entree 13`).
|
|
46
|
+
*/
|
|
47
|
+
StreetTrailingUnit: "street:trailing-unit",
|
|
48
|
+
/**
|
|
49
|
+
* The region is no name or abbreviation of a region or macroregion of the row's country
|
|
50
|
+
* in the WOF admin database, in a country where that database holds regions.
|
|
51
|
+
*/
|
|
52
|
+
RegionUnknown: "region:unknown",
|
|
33
53
|
};
|
|
34
54
|
/**
|
|
35
55
|
* The rules a build quarantines a row for.
|
|
@@ -38,12 +58,29 @@ export const ComponentRule = {
|
|
|
38
58
|
* The v0.8.9 dry run (#2898) found 522,089 rows failing it, among them legitimate partial
|
|
39
59
|
* postcodes (WOF's Dutch `3704`) and spaced written forms (`31 261` in Kraków), beside the defects
|
|
40
60
|
* it is meant for (NAD's 425,667 short ZIP Codes and Overture Brazil's dropped leading zeros).
|
|
61
|
+
*
|
|
62
|
+
* `locality:repeats-region` is reported but not enforced, because a publisher's own `NY` for
|
|
63
|
+
* New York City (`150 E 71 ST, NY, NY 10021`) fails it beside the rows whose city was lost.
|
|
64
|
+
*
|
|
65
|
+
* `street:trailing-unit` is reported but not enforced, because some streets end in a
|
|
66
|
+
* word a country also writes as a unit (`Morning Side`, `Skijor Steppe Upper`).
|
|
67
|
+
*
|
|
68
|
+
* `region:unknown` is reported but not enforced, because neither source holds every
|
|
69
|
+
* form addresses write: Swiss canton codes (`TG`), Latvia's post-2021 municipalities
|
|
70
|
+
* (`Valmieras nov.`), Bangkok's short `กรุงเทพ`.
|
|
41
71
|
*/
|
|
42
72
|
export const ENFORCED_COMPONENT_RULES = new Set([
|
|
43
73
|
ComponentRule.StreetRepeatsPostcode,
|
|
44
74
|
ComponentRule.StreetHoldsPlace,
|
|
45
75
|
ComponentRule.LocalityHoldsStreet,
|
|
76
|
+
ComponentRule.PostcodeRepeatsRegion,
|
|
46
77
|
]);
|
|
78
|
+
/**
|
|
79
|
+
* {@linkcode ComponentFindingCounts} as a JSON object, in the order each source and rule was first counted.
|
|
80
|
+
*/
|
|
81
|
+
export function componentFindingsRecord(counts) {
|
|
82
|
+
return Object.fromEntries([...counts].map(([source, rules]) => [source, Object.fromEntries(rules)]));
|
|
83
|
+
}
|
|
47
84
|
/**
|
|
48
85
|
* The fewest digits a street's ending needs before it is compared with the row's postcode.
|
|
49
86
|
*/
|
|
@@ -56,10 +93,10 @@ const fold = (text) => text
|
|
|
56
93
|
/**
|
|
57
94
|
* The rules `components` fails for a row of `country`, in rule order.
|
|
58
95
|
*/
|
|
59
|
-
export function componentFindings(components, country) {
|
|
96
|
+
export function componentFindings(components, country, context = {}) {
|
|
60
97
|
const findings = [];
|
|
61
98
|
const { postcode, street, locality, region } = components;
|
|
62
|
-
if (postcode &&
|
|
99
|
+
if (postcode && statesPostcodeSyntax(country) && acceptPostcode(postcode, country) == null) {
|
|
63
100
|
findings.push({ rule: ComponentRule.PostcodeFormat, values: [postcode] });
|
|
64
101
|
}
|
|
65
102
|
if (street && postcode) {
|
|
@@ -90,6 +127,31 @@ export function componentFindings(components, country) {
|
|
|
90
127
|
findings.push({ rule: ComponentRule.LocalityHoldsStreet, values: [locality, houseNumber, street] });
|
|
91
128
|
}
|
|
92
129
|
}
|
|
130
|
+
if (postcode && region && fold(postcode) === fold(region)) {
|
|
131
|
+
findings.push({ rule: ComponentRule.PostcodeRepeatsRegion, values: [postcode, region] });
|
|
132
|
+
}
|
|
133
|
+
// A city may share its region's name (`Berlin, Berlin`, `أبو ظبي, أبو ظبي`),
|
|
134
|
+
// but no city is written as its region's code. libaddressinput's keys and ISO ids state
|
|
135
|
+
// which codes a country's addresses write.
|
|
136
|
+
if (locality && region) {
|
|
137
|
+
const regionCode = writtenSubdivisionCode(country, region);
|
|
138
|
+
if (regionCode != null && fold(locality) === fold(regionCode)) {
|
|
139
|
+
findings.push({ rule: ComponentRule.LocalityRepeatsRegion, values: [locality, region] });
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (street && context.units) {
|
|
143
|
+
const trailing = context.units.trailingUnit(street, {
|
|
144
|
+
country,
|
|
145
|
+
...(locality ? { locality } : {}),
|
|
146
|
+
...(postcode ? { postcode } : {}),
|
|
147
|
+
});
|
|
148
|
+
if (trailing) {
|
|
149
|
+
findings.push({ rule: ComponentRule.StreetTrailingUnit, values: [street, trailing.unit] });
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (region && context.regions?.holds(country, region) === false) {
|
|
153
|
+
findings.push({ rule: ComponentRule.RegionUnknown, values: [region] });
|
|
154
|
+
}
|
|
93
155
|
return findings;
|
|
94
156
|
}
|
|
95
157
|
//# sourceMappingURL=component-check.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-check.js","sourceRoot":"","sources":["../../lib/build/component-check.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;GAOG;AAEH,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"component-check.js","sourceRoot":"","sources":["../../lib/build/component-check.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;GAOG;AAEH,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAG1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAA;AAI9E;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B;;OAEG;IACH,cAAc,EAAE,iBAAiB;IACjC;;OAEG;IACH,qBAAqB,EAAE,yBAAyB;IAChD;;OAEG;IACH,gBAAgB,EAAE,oBAAoB;IACtC;;;OAGG;IACH,mBAAmB,EAAE,uBAAuB;IAC5C;;OAEG;IACH,qBAAqB,EAAE,yBAAyB;IAChD;;;OAGG;IACH,qBAAqB,EAAE,yBAAyB;IAChD;;;OAGG;IACH,kBAAkB,EAAE,sBAAsB;IAC1C;;;OA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,EAAE,MAAM,CAAC,EAAE,CAAC,CAAA;QACzF,CAAC;IACF,CAAC;IAED,IAAI,MAAM,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE;YACnD,OAAO;YACP,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACjC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACjC,CAAC,CAAA;QAEF,IAAI,QAAQ,EAAE,CAAC;YACd,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,kBAAkB,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAC3F,CAAC;IACF,CAAC;IAED,IAAI,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,KAAK,EAAE,CAAC;QACjE,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IACvE,CAAC;IAED,OAAO,QAAQ,CAAA;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../lib/build/manifest.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../lib/build/manifest.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,C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AAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAgFnG"}
|
package/out/build/manifest.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* each source's completion record. Both reach the same two files through this one function.
|
|
8
8
|
*/
|
|
9
9
|
import { writeLocalJSONFile } from "@mailwoman/core/fs/writers";
|
|
10
|
+
import { componentFindingsRecord, ENFORCED_COMPONENT_RULES } from "#build/component-check";
|
|
10
11
|
import { TRAINING_MANIFEST_FILE } from "#build/types";
|
|
11
12
|
import { committedRowLicenses } from "#source-register/row-license";
|
|
12
13
|
import { freezeTrainingManifest } from "#source-register/training-manifest";
|
|
@@ -56,6 +57,9 @@ export async function writeBuildManifests(inputs) {
|
|
|
56
57
|
files_read: inputs.holdoutCheck.files_read,
|
|
57
58
|
},
|
|
58
59
|
quarantine_count: totals.quarantined,
|
|
60
|
+
component_findings_by_source: componentFindingsRecord(totals.componentFindingsBySource),
|
|
61
|
+
enforced_component_rules: [...ENFORCED_COMPONENT_RULES],
|
|
62
|
+
unchecked_component_rules: [...totals.uncheckedComponentRules],
|
|
59
63
|
total_aligned_rows: totals.aligned,
|
|
60
64
|
licenses: Object.fromEntries(licenseSummary),
|
|
61
65
|
licenses_cover: "the rows this build aligned from its adapters. An overlay parquet assembled afterwards carries its " +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../lib/build/manifest.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;GAKG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../lib/build/manifest.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;GAKG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAI/D,OAAO,EAAE,uBAAuB,EAA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@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parallel.d.ts","sourceRoot":"","sources":["../../lib/build/parallel.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAO3D,OAAO,
|
|
1
|
+
{"version":3,"file":"parallel.d.ts","sourceRoot":"","sources":["../../lib/build/parallel.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAO3D,OAAO,EAA0C,KAAK,YAAY,EAAoB,MAAM,eAAe,CAAA;AAI3G,OAAO,EAAwC,KAAK,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAQlG,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAc,MAAM,cAAc,CAAA;AAKvF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAG3C;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,QAAgB,CAAA;AAE9C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,kBAAkB,CAAA;IACxB;;OAEG;IACH,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAA;IAClC,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,EAAE,qBAAqB,CAAA;IAC/B,MAAM,EAAE,qBAAqB,CAAA;IAC7B,SAAS,EAAE,WAAW,CAAA;IACtB,eAAe,EAAE,WAAW,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,YAAY,CAAA;CACpB;AA0OD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvF;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,WAAW,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ9G;AAUD;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA4P9F"}
|
package/out/build/parallel.js
CHANGED
|
@@ -35,7 +35,7 @@ import { adapterRunInputs, reusableRun } from "#build/adapters";
|
|
|
35
35
|
import { alignSettings } from "#build/align";
|
|
36
36
|
import { planAlignRanges, reusableAlignRange } from "#build/align/range";
|
|
37
37
|
import { mergeAlignTotals } from "#build/align/totals";
|
|
38
|
-
import {
|
|
38
|
+
import { WORKER_CLASSES, workerReservationBytes } from "#build/budget";
|
|
39
39
|
import { readSourceDecisionTable } from "#build/eligibility";
|
|
40
40
|
import { admitParquetManifest, UNCHECKED_PARQUET_MANIFEST_FILE } from "#build/holdout-check";
|
|
41
41
|
import { writeBuildManifests } from "#build/manifest";
|
|
@@ -124,35 +124,19 @@ class WorkerPool {
|
|
|
124
124
|
#admits(pending) {
|
|
125
125
|
if (this.#running.size >= this.#jobs)
|
|
126
126
|
return false;
|
|
127
|
-
|
|
128
|
-
return false;
|
|
129
|
-
if (pending.workerClass === "resident") {
|
|
130
|
-
for (const { workerClass } of this.#running.values()) {
|
|
131
|
-
if (workerClass === "resident")
|
|
132
|
-
return false;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return true;
|
|
127
|
+
return this.#reservedBytes() + workerReservationBytes(pending.workerClass) <= this.#budgetBytes;
|
|
136
128
|
}
|
|
137
129
|
#dispatch() {
|
|
138
130
|
if (this.#cancelled)
|
|
139
131
|
return;
|
|
140
132
|
// Highest priority first.
|
|
141
|
-
// A task that doesn't fit waits rather than letting a smaller one pass it
|
|
142
|
-
// a resident adapter waiting on another resident adapter doesn't hold up standard work.
|
|
133
|
+
// A task that doesn't fit waits rather than letting a smaller one pass it.
|
|
143
134
|
const ordered = this.#queue.toSorted((a, b) => b.priority[0] - a.priority[0] || b.priority[1] - a.priority[1]);
|
|
144
135
|
for (const pending of ordered) {
|
|
145
|
-
if (this.#running.size >= this.#jobs)
|
|
146
|
-
return;
|
|
147
|
-
if (this.#admits(pending)) {
|
|
148
|
-
this.#queue.splice(this.#queue.indexOf(pending), 1);
|
|
149
|
-
void this.#start(pending);
|
|
150
|
-
continue;
|
|
151
|
-
}
|
|
152
|
-
const blockedOnResident = pending.workerClass === "resident" &&
|
|
153
|
-
[...this.#running.values()].some((running) => running.workerClass === "resident");
|
|
154
|
-
if (!blockedOnResident)
|
|
136
|
+
if (this.#running.size >= this.#jobs || !this.#admits(pending))
|
|
155
137
|
return;
|
|
138
|
+
this.#queue.splice(this.#queue.indexOf(pending), 1);
|
|
139
|
+
void this.#start(pending);
|
|
156
140
|
}
|
|
157
141
|
}
|
|
158
142
|
async #start(pending) {
|
|
@@ -352,14 +336,14 @@ export async function runParallelBuild(ctx) {
|
|
|
352
336
|
kind: "adapter",
|
|
353
337
|
id: `${source}/adapter`,
|
|
354
338
|
source,
|
|
355
|
-
resources: WORKER_CLASSES
|
|
339
|
+
resources: WORKER_CLASSES.standard,
|
|
356
340
|
temporaryRoot: temporaryRoot("adapter"),
|
|
357
341
|
adapterModule: derivationFor.modules.get(source),
|
|
358
342
|
adapterOptions: { ...serializable, inputPath: options.inputPath.toString() },
|
|
359
343
|
corpusVersion: opts.corpusVersion,
|
|
360
344
|
inputs,
|
|
361
345
|
intermediateDir: intermediateDir.toString(),
|
|
362
|
-
},
|
|
346
|
+
}, "standard", inputWeight);
|
|
363
347
|
run = await readLocalJSONFile(adapterDir("MANIFEST.json"));
|
|
364
348
|
}
|
|
365
349
|
const canonicalPath = run.jsonl_path;
|