mailwoman 8.0.0 → 8.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/api-engine.ts +57 -20
- package/cli-kit/index.ts +11 -5
- package/cli-kit/weights-guard.tsx +24 -8
- package/commands/autocomplete.tsx +12 -7
- package/commands/corpus/align-shard.tsx +1 -0
- package/commands/corpus/audit.tsx +3 -3
- package/commands/corpus/build.tsx +5 -2
- package/commands/corpus/download.tsx +17 -15
- package/commands/corpus/fetch.tsx +4 -4
- package/commands/corpus/list.tsx +1 -1
- package/commands/corpus/overlay-manifest.tsx +1 -0
- package/commands/corpus/run.tsx +3 -2
- package/commands/corpus/shard/index.tsx +12 -3
- package/commands/corpus/stats.tsx +1 -0
- package/commands/corpus/upload.tsx +17 -15
- package/commands/dev/jsonl-to-parquet.tsx +1 -1
- package/commands/dev/lint/shard-vocab.tsx +1 -1
- package/commands/doctor.tsx +9 -3
- package/commands/eval/gauntlet-build.tsx +3 -3
- package/commands/gazetteer/affix-relabel.tsx +2 -2
- package/commands/gazetteer/anchor-lexicon.tsx +26 -8
- package/commands/gazetteer/build/candidate.tsx +7 -0
- package/commands/gazetteer/build/coincident-roles.tsx +12 -5
- package/commands/gazetteer/build/fst.tsx +61 -0
- package/commands/gazetteer/build/fts.tsx +7 -4
- package/commands/gazetteer/build/index.tsx +4 -0
- package/commands/gazetteer/build/locality-surface-lexicon.tsx +51 -0
- package/commands/gazetteer/build/poi-brands.tsx +2 -0
- package/commands/gazetteer/build/poi.tsx +5 -1
- package/commands/gazetteer/build/postcode-locality.tsx +9 -0
- package/commands/gazetteer/build/street-morphology.tsx +55 -0
- package/commands/gazetteer/build/street-type-lexicon.tsx +37 -0
- package/commands/gazetteer/conventions.tsx +6 -0
- package/commands/gazetteer/importance.tsx +36 -4
- package/commands/gazetteer/inspect/fst.tsx +14 -6
- package/commands/gazetteer/inspect/graph.tsx +1 -0
- package/commands/gazetteer/inspect/mermaid.tsx +8 -4
- package/commands/gazetteer/inspect/placetype-stats.tsx +21 -6
- package/commands/gazetteer/inspect/sync.tsx +2 -1
- package/commands/gazetteer/inspect/tree.tsx +1 -0
- package/commands/gazetteer/overture-ingest.tsx +20 -2
- package/commands/gazetteer/pair-index.tsx +3 -0
- package/commands/gazetteer/polygons.tsx +38 -5
- package/commands/gazetteer/postal-alias.tsx +8 -0
- package/commands/gazetteer/postal-city.tsx +18 -1
- package/commands/gazetteer/postcode-binary.tsx +10 -1
- package/commands/gazetteer/postcode-intl.tsx +33 -4
- package/commands/gazetteer/promote.tsx +1 -0
- package/commands/gazetteer/publish.tsx +4 -0
- package/commands/gazetteer/release.tsx +11 -0
- package/commands/gazetteer/verify.tsx +2 -0
- package/commands/geocode.tsx +34 -28
- package/commands/gnaf/assemble.tsx +1 -0
- package/commands/parse.tsx +53 -30
- package/commands/placer/eval.tsx +5 -4
- package/commands/poi.tsx +12 -7
- package/commands/registry/dedup-ceiling.tsx +1 -1
- package/commands/registry/gold-set-sample.tsx +1 -1
- package/commands/registry/run.tsx +61 -26
- package/commands/registry/scorer-eval.tsx +6 -4
- package/commands/registry/train-scorer.tsx +6 -4
- package/commands/registry/viz.tsx +5 -4
- package/commands/release/hf.tsx +11 -3
- package/commands/reverse.tsx +14 -5
- package/commands/serve.tsx +8 -1
- package/commands/situs/address-points.tsx +24 -6
- package/commands/situs/attribution-manifest.tsx +13 -3
- package/commands/situs/build.tsx +44 -13
- package/commands/situs/interpolation-shard.tsx +52 -5
- package/commands/situs/interpolation.tsx +140 -47
- package/commands/tiger/fetch.tsx +3 -0
- package/commands/tiger/race-dots-map.tsx +1 -0
- package/commands/tiger/redistricting.tsx +3 -0
- package/coverage-core.ts +94 -24
- package/data-release.ts +8 -3
- package/default-placer.ts +9 -3
- package/default-reverse-geocoder.ts +1 -1
- package/dev-tools/capture-v1-parse.run.ts +3 -1
- package/dev-tools/convert-parity-fixtures.run.ts +25 -11
- package/dev-tools/extract-parity-corpus.run.ts +1 -1
- package/dev-tools/failure-census.run.ts +0 -0
- package/dev-tools/failure-report.run.ts +0 -0
- package/dev-tools/generate-trace-fixture.ts +15 -5
- package/dev-tools/lint-mdx-angles.ts +24 -9
- package/dev-tools/parity-extract.ts +15 -5
- package/dev-tools/router-kind-probe.run.ts +2 -2
- package/dev-tools/us-recall-flip-census.run.ts +11 -3
- package/doctor/checks.ts +121 -44
- package/doctor/runner.ts +69 -24
- package/eval-harness/baseline-assert.ts +59 -19
- package/eval-harness/capability-manifest.ts +81 -40
- package/eval-harness/digit-board.ts +13 -5
- package/eval-harness/error-analysis.ts +49 -12
- package/eval-harness/es-postcode-centroids.ts +26 -5
- package/eval-harness/fragment-board.ts +23 -7
- package/eval-harness/fragment-dev.ts +8 -3
- package/eval-harness/gates/v6.0.0-shipped-baseline.json +1 -1
- package/eval-harness/gauntlet/build-fdic-holdout.ts +54 -5
- package/eval-harness/gauntlet/build-regression-db.ts +7 -1
- package/eval-harness/gauntlet/cases/regression.ts +46 -37
- package/eval-harness/gauntlet/harness.ts +18 -4
- package/eval-harness/gauntlet/holdout.ts +50 -10
- package/eval-harness/gauntlet/metamorphic.ts +102 -41
- package/eval-harness/gauntlet/regression.ts +22 -6
- package/eval-harness/gauntlet/run.ts +26 -8
- package/eval-harness/gauntlet/schema.ts +64 -21
- package/eval-harness/invariance/command.ts +15 -4
- package/eval-harness/invariance/compare.ts +13 -5
- package/eval-harness/invariance/runner.ts +61 -31
- package/eval-harness/invariance/transforms.ts +55 -34
- package/eval-harness/ledger-append.ts +38 -11
- package/eval-harness/mask-regression.ts +66 -30
- package/eval-harness/oa-resolver-eval.ts +443 -305
- package/eval-harness/oa-resolver-report.ts +213 -0
- package/eval-harness/oracle-k.ts +81 -26
- package/eval-harness/parity-corpus.ts +46 -13
- package/eval-harness/poi-board.ts +79 -30
- package/eval-harness/preset-compare.ts +16 -4
- package/eval-harness/promotion-gate-verdict.ts +34 -10
- package/eval-harness/promotion-gate.ts +137 -53
- package/eval-harness/v0-tree-adapter.ts +14 -5
- package/gazetteer-pipeline/admin/enrich.ts +13 -3
- package/gazetteer-pipeline/admin/fold-geonames.ts +26 -14
- package/gazetteer-pipeline/admin/fold-overture.ts +14 -2
- package/gazetteer-pipeline/admin/freeze.ts +5 -2
- package/gazetteer-pipeline/admin/index.ts +28 -7
- package/gazetteer-pipeline/admin/ingest-wof.ts +31 -9
- package/gazetteer-pipeline/anchor-lookup.ts +65 -19
- package/gazetteer-pipeline/coverage-manifest.ts +175 -0
- package/gazetteer-pipeline/defaults.ts +15 -5
- package/gazetteer-pipeline/evidence-lexicons.ts +619 -0
- package/gazetteer-pipeline/fst.ts +315 -0
- package/gazetteer-pipeline/fts.ts +7 -2
- package/gazetteer-pipeline/index.ts +73 -20
- package/gazetteer-pipeline/pair-index-hierarchy-probe.ts +320 -0
- package/gazetteer-pipeline/pair-index-hierarchy-verify.ts +283 -0
- package/gazetteer-pipeline/pair-index.ts +48 -27
- package/gazetteer-pipeline/poi/build-brands.ts +32 -11
- package/gazetteer-pipeline/poi/build-poi.ts +92 -28
- package/gazetteer-pipeline/postcode/centroid-fills.ts +29 -8
- package/gazetteer-pipeline/postcode/index.ts +28 -7
- package/gazetteer-pipeline/postcode/nl-pc6.ts +12 -2
- package/gazetteer-pipeline/postcode/zcta-centroids.ts +16 -2
- package/gazetteer-pipeline/postcode-locality/base.ts +63 -25
- package/gazetteer-pipeline/postcode-locality/jp.ts +64 -26
- package/gazetteer-pipeline/postcode-locality/kr.ts +51 -24
- package/gazetteer-pipeline/postcode-locality/tw.ts +130 -65
- package/gazetteer-pipeline/street-morphology.ts +105 -0
- package/gazetteer-pipeline/verify-baseline.ts +5 -1
- package/gazetteer-pipeline/verify.ts +31 -10
- package/geocode-core.ts +139 -44
- package/geocode-stream.ts +27 -9
- package/geocode-worker.ts +4 -0
- package/interp-calibration.ts +3 -1
- package/kbest-street-rerank.ts +37 -19
- package/out/api-engine.d.ts +3 -1
- package/out/api-engine.d.ts.map +1 -1
- package/out/api-engine.js +39 -16
- package/out/api-engine.js.map +1 -1
- package/out/cli-kit/index.d.ts +10 -6
- package/out/cli-kit/index.d.ts.map +1 -1
- package/out/cli-kit/index.js.map +1 -1
- package/out/cli-kit/weights-guard.d.ts +24 -8
- package/out/cli-kit/weights-guard.d.ts.map +1 -1
- package/out/cli-kit/weights-guard.js +6 -2
- package/out/cli-kit/weights-guard.js.map +1 -1
- package/out/commands/autocomplete.d.ts +6 -1
- package/out/commands/autocomplete.d.ts.map +1 -1
- package/out/commands/autocomplete.js +12 -7
- package/out/commands/autocomplete.js.map +1 -1
- package/out/commands/corpus/align-shard.d.ts.map +1 -1
- package/out/commands/corpus/align-shard.js.map +1 -1
- package/out/commands/corpus/audit.d.ts +3 -3
- package/out/commands/corpus/audit.d.ts.map +1 -1
- package/out/commands/corpus/audit.js +2 -2
- package/out/commands/corpus/audit.js.map +1 -1
- package/out/commands/corpus/build.d.ts.map +1 -1
- package/out/commands/corpus/build.js +2 -2
- package/out/commands/corpus/build.js.map +1 -1
- package/out/commands/corpus/download.d.ts.map +1 -1
- package/out/commands/corpus/download.js +12 -13
- package/out/commands/corpus/download.js.map +1 -1
- package/out/commands/corpus/fetch.d.ts +3 -3
- package/out/commands/corpus/fetch.d.ts.map +1 -1
- package/out/commands/corpus/fetch.js +3 -3
- package/out/commands/corpus/fetch.js.map +1 -1
- package/out/commands/corpus/list.js +1 -1
- package/out/commands/corpus/list.js.map +1 -1
- package/out/commands/corpus/overlay-manifest.d.ts.map +1 -1
- package/out/commands/corpus/overlay-manifest.js.map +1 -1
- package/out/commands/corpus/run.d.ts.map +1 -1
- package/out/commands/corpus/run.js +2 -2
- package/out/commands/corpus/run.js.map +1 -1
- package/out/commands/corpus/shard/index.d.ts +3 -1
- package/out/commands/corpus/shard/index.d.ts.map +1 -1
- package/out/commands/corpus/shard/index.js +7 -3
- package/out/commands/corpus/shard/index.js.map +1 -1
- package/out/commands/corpus/stats.d.ts.map +1 -1
- package/out/commands/corpus/stats.js.map +1 -1
- package/out/commands/corpus/upload.d.ts.map +1 -1
- package/out/commands/corpus/upload.js +12 -13
- package/out/commands/corpus/upload.js.map +1 -1
- package/out/commands/dev/jsonl-to-parquet.js +1 -1
- package/out/commands/dev/jsonl-to-parquet.js.map +1 -1
- package/out/commands/dev/lint/shard-vocab.js +1 -1
- package/out/commands/dev/lint/shard-vocab.js.map +1 -1
- package/out/commands/doctor.d.ts.map +1 -1
- package/out/commands/doctor.js +9 -3
- package/out/commands/doctor.js.map +1 -1
- package/out/commands/eval/gauntlet-build.d.ts +3 -3
- package/out/commands/eval/gauntlet-build.d.ts.map +1 -1
- package/out/commands/eval/gauntlet-build.js +2 -2
- package/out/commands/eval/gauntlet-build.js.map +1 -1
- package/out/commands/gazetteer/affix-relabel.js +2 -2
- package/out/commands/gazetteer/affix-relabel.js.map +1 -1
- package/out/commands/gazetteer/anchor-lexicon.d.ts.map +1 -1
- package/out/commands/gazetteer/anchor-lexicon.js +21 -8
- package/out/commands/gazetteer/anchor-lexicon.js.map +1 -1
- package/out/commands/gazetteer/build/candidate.d.ts.map +1 -1
- package/out/commands/gazetteer/build/candidate.js.map +1 -1
- package/out/commands/gazetteer/build/coincident-roles.d.ts +3 -3
- package/out/commands/gazetteer/build/coincident-roles.d.ts.map +1 -1
- package/out/commands/gazetteer/build/coincident-roles.js +5 -5
- package/out/commands/gazetteer/build/coincident-roles.js.map +1 -1
- package/out/commands/gazetteer/build/fst.d.ts +22 -0
- package/out/commands/gazetteer/build/fst.d.ts.map +1 -0
- package/out/commands/gazetteer/build/fst.js +42 -0
- package/out/commands/gazetteer/build/fst.js.map +1 -0
- package/out/commands/gazetteer/build/fts.d.ts +3 -3
- package/out/commands/gazetteer/build/fts.d.ts.map +1 -1
- package/out/commands/gazetteer/build/fts.js +3 -3
- package/out/commands/gazetteer/build/fts.js.map +1 -1
- package/out/commands/gazetteer/build/index.d.ts.map +1 -1
- package/out/commands/gazetteer/build/index.js.map +1 -1
- package/out/commands/gazetteer/build/locality-surface-lexicon.d.ts +22 -0
- package/out/commands/gazetteer/build/locality-surface-lexicon.d.ts.map +1 -0
- package/out/commands/gazetteer/build/locality-surface-lexicon.js +44 -0
- package/out/commands/gazetteer/build/locality-surface-lexicon.js.map +1 -0
- package/out/commands/gazetteer/build/poi-brands.d.ts.map +1 -1
- package/out/commands/gazetteer/build/poi-brands.js.map +1 -1
- package/out/commands/gazetteer/build/poi.d.ts.map +1 -1
- package/out/commands/gazetteer/build/poi.js +1 -1
- package/out/commands/gazetteer/build/poi.js.map +1 -1
- package/out/commands/gazetteer/build/postcode-locality.d.ts.map +1 -1
- package/out/commands/gazetteer/build/postcode-locality.js.map +1 -1
- package/out/commands/gazetteer/build/street-morphology.d.ts +22 -0
- package/out/commands/gazetteer/build/street-morphology.d.ts.map +1 -0
- package/out/commands/gazetteer/build/street-morphology.js +47 -0
- package/out/commands/gazetteer/build/street-morphology.js.map +1 -0
- package/out/commands/gazetteer/build/street-type-lexicon.d.ts +18 -0
- package/out/commands/gazetteer/build/street-type-lexicon.d.ts.map +1 -0
- package/out/commands/gazetteer/build/street-type-lexicon.js +31 -0
- package/out/commands/gazetteer/build/street-type-lexicon.js.map +1 -0
- package/out/commands/gazetteer/conventions.d.ts.map +1 -1
- package/out/commands/gazetteer/conventions.js.map +1 -1
- package/out/commands/gazetteer/importance.d.ts.map +1 -1
- package/out/commands/gazetteer/importance.js +16 -4
- package/out/commands/gazetteer/importance.js.map +1 -1
- package/out/commands/gazetteer/inspect/fst.d.ts.map +1 -1
- package/out/commands/gazetteer/inspect/fst.js +6 -6
- package/out/commands/gazetteer/inspect/fst.js.map +1 -1
- package/out/commands/gazetteer/inspect/graph.d.ts.map +1 -1
- package/out/commands/gazetteer/inspect/graph.js.map +1 -1
- package/out/commands/gazetteer/inspect/mermaid.d.ts.map +1 -1
- package/out/commands/gazetteer/inspect/mermaid.js +6 -4
- package/out/commands/gazetteer/inspect/mermaid.js.map +1 -1
- package/out/commands/gazetteer/inspect/placetype-stats.d.ts.map +1 -1
- package/out/commands/gazetteer/inspect/placetype-stats.js +10 -4
- package/out/commands/gazetteer/inspect/placetype-stats.js.map +1 -1
- package/out/commands/gazetteer/inspect/sync.d.ts.map +1 -1
- package/out/commands/gazetteer/inspect/sync.js +1 -1
- package/out/commands/gazetteer/inspect/sync.js.map +1 -1
- package/out/commands/gazetteer/inspect/tree.d.ts.map +1 -1
- package/out/commands/gazetteer/inspect/tree.js.map +1 -1
- package/out/commands/gazetteer/overture-ingest.d.ts.map +1 -1
- package/out/commands/gazetteer/overture-ingest.js +6 -2
- package/out/commands/gazetteer/overture-ingest.js.map +1 -1
- package/out/commands/gazetteer/pair-index.d.ts.map +1 -1
- package/out/commands/gazetteer/pair-index.js.map +1 -1
- package/out/commands/gazetteer/polygons.d.ts.map +1 -1
- package/out/commands/gazetteer/polygons.js +19 -5
- package/out/commands/gazetteer/polygons.js.map +1 -1
- package/out/commands/gazetteer/postal-alias.d.ts.map +1 -1
- package/out/commands/gazetteer/postal-alias.js.map +1 -1
- package/out/commands/gazetteer/postal-city.d.ts.map +1 -1
- package/out/commands/gazetteer/postal-city.js +2 -1
- package/out/commands/gazetteer/postal-city.js.map +1 -1
- package/out/commands/gazetteer/postcode-binary.d.ts.map +1 -1
- package/out/commands/gazetteer/postcode-binary.js +1 -1
- package/out/commands/gazetteer/postcode-binary.js.map +1 -1
- package/out/commands/gazetteer/postcode-intl.d.ts.map +1 -1
- package/out/commands/gazetteer/postcode-intl.js +4 -2
- package/out/commands/gazetteer/postcode-intl.js.map +1 -1
- package/out/commands/gazetteer/promote.d.ts.map +1 -1
- package/out/commands/gazetteer/promote.js.map +1 -1
- package/out/commands/gazetteer/publish.d.ts.map +1 -1
- package/out/commands/gazetteer/publish.js.map +1 -1
- package/out/commands/gazetteer/release.d.ts.map +1 -1
- package/out/commands/gazetteer/release.js.map +1 -1
- package/out/commands/gazetteer/verify.d.ts.map +1 -1
- package/out/commands/gazetteer/verify.js.map +1 -1
- package/out/commands/geocode.d.ts.map +1 -1
- package/out/commands/geocode.js +20 -28
- package/out/commands/geocode.js.map +1 -1
- package/out/commands/gnaf/assemble.d.ts.map +1 -1
- package/out/commands/gnaf/assemble.js.map +1 -1
- package/out/commands/parse.d.ts +4 -0
- package/out/commands/parse.d.ts.map +1 -1
- package/out/commands/parse.js +37 -25
- package/out/commands/parse.js.map +1 -1
- package/out/commands/placer/eval.d.ts +3 -3
- package/out/commands/placer/eval.d.ts.map +1 -1
- package/out/commands/placer/eval.js +2 -2
- package/out/commands/placer/eval.js.map +1 -1
- package/out/commands/poi.d.ts.map +1 -1
- package/out/commands/poi.js +11 -7
- package/out/commands/poi.js.map +1 -1
- package/out/commands/registry/dedup-ceiling.js +1 -1
- package/out/commands/registry/dedup-ceiling.js.map +1 -1
- package/out/commands/registry/gold-set-sample.js +1 -1
- package/out/commands/registry/gold-set-sample.js.map +1 -1
- package/out/commands/registry/run.d.ts +24 -8
- package/out/commands/registry/run.d.ts.map +1 -1
- package/out/commands/registry/run.js +20 -20
- package/out/commands/registry/run.js.map +1 -1
- package/out/commands/registry/scorer-eval.d.ts +3 -3
- package/out/commands/registry/scorer-eval.d.ts.map +1 -1
- package/out/commands/registry/scorer-eval.js +2 -2
- package/out/commands/registry/scorer-eval.js.map +1 -1
- package/out/commands/registry/train-scorer.d.ts +3 -3
- package/out/commands/registry/train-scorer.d.ts.map +1 -1
- package/out/commands/registry/train-scorer.js +2 -2
- package/out/commands/registry/train-scorer.js.map +1 -1
- package/out/commands/registry/viz.d.ts +3 -3
- package/out/commands/registry/viz.d.ts.map +1 -1
- package/out/commands/registry/viz.js +2 -2
- package/out/commands/registry/viz.js.map +1 -1
- package/out/commands/release/hf.d.ts +5 -3
- package/out/commands/release/hf.d.ts.map +1 -1
- package/out/commands/release/hf.js +10 -2
- package/out/commands/release/hf.js.map +1 -1
- package/out/commands/reverse.d.ts.map +1 -1
- package/out/commands/reverse.js +12 -5
- package/out/commands/reverse.js.map +1 -1
- package/out/commands/serve.d.ts.map +1 -1
- package/out/commands/serve.js +2 -1
- package/out/commands/serve.js.map +1 -1
- package/out/commands/situs/address-points.d.ts.map +1 -1
- package/out/commands/situs/address-points.js +3 -3
- package/out/commands/situs/address-points.js.map +1 -1
- package/out/commands/situs/attribution-manifest.d.ts.map +1 -1
- package/out/commands/situs/attribution-manifest.js +2 -2
- package/out/commands/situs/attribution-manifest.js.map +1 -1
- package/out/commands/situs/build.d.ts.map +1 -1
- package/out/commands/situs/build.js +13 -11
- package/out/commands/situs/build.js.map +1 -1
- package/out/commands/situs/interpolation-shard.d.ts.map +1 -1
- package/out/commands/situs/interpolation-shard.js +29 -5
- package/out/commands/situs/interpolation-shard.js.map +1 -1
- package/out/commands/situs/interpolation.d.ts.map +1 -1
- package/out/commands/situs/interpolation.js +63 -34
- package/out/commands/situs/interpolation.js.map +1 -1
- package/out/commands/tiger/fetch.d.ts.map +1 -1
- package/out/commands/tiger/fetch.js.map +1 -1
- package/out/commands/tiger/race-dots-map.d.ts.map +1 -1
- package/out/commands/tiger/race-dots-map.js.map +1 -1
- package/out/commands/tiger/redistricting.d.ts.map +1 -1
- package/out/commands/tiger/redistricting.js.map +1 -1
- package/out/coverage-core.d.ts +51 -17
- package/out/coverage-core.d.ts.map +1 -1
- package/out/coverage-core.js +18 -7
- package/out/coverage-core.js.map +1 -1
- package/out/data-release.d.ts +6 -2
- package/out/data-release.d.ts.map +1 -1
- package/out/data-release.js +4 -2
- package/out/data-release.js.map +1 -1
- package/out/default-placer.d.ts +6 -2
- package/out/default-placer.d.ts.map +1 -1
- package/out/default-placer.js +3 -1
- package/out/default-placer.js.map +1 -1
- package/out/default-reverse-geocoder.js +1 -1
- package/out/default-reverse-geocoder.js.map +1 -1
- package/out/dev-tools/capture-v1-parse.run.js +0 -1
- package/out/dev-tools/capture-v1-parse.run.js.map +1 -1
- package/out/dev-tools/convert-parity-fixtures.run.d.ts +18 -6
- package/out/dev-tools/convert-parity-fixtures.run.d.ts.map +1 -1
- package/out/dev-tools/convert-parity-fixtures.run.js +6 -5
- package/out/dev-tools/convert-parity-fixtures.run.js.map +1 -1
- package/out/dev-tools/extract-parity-corpus.run.js +1 -1
- package/out/dev-tools/extract-parity-corpus.run.js.map +1 -1
- package/out/dev-tools/failure-census.run.js +0 -0
- package/out/dev-tools/failure-census.run.js.map +1 -1
- package/out/dev-tools/failure-report.run.js +0 -0
- package/out/dev-tools/failure-report.run.js.map +1 -1
- package/out/dev-tools/generate-trace-fixture.d.ts +15 -5
- package/out/dev-tools/generate-trace-fixture.d.ts.map +1 -1
- package/out/dev-tools/generate-trace-fixture.js +3 -1
- package/out/dev-tools/generate-trace-fixture.js.map +1 -1
- package/out/dev-tools/lint-mdx-angles.d.ts +18 -6
- package/out/dev-tools/lint-mdx-angles.d.ts.map +1 -1
- package/out/dev-tools/lint-mdx-angles.js +6 -4
- package/out/dev-tools/lint-mdx-angles.js.map +1 -1
- package/out/dev-tools/parity-extract.d.ts +15 -5
- package/out/dev-tools/parity-extract.d.ts.map +1 -1
- package/out/dev-tools/parity-extract.js +3 -1
- package/out/dev-tools/parity-extract.js.map +1 -1
- package/out/dev-tools/router-kind-probe.run.js +2 -2
- package/out/dev-tools/router-kind-probe.run.js.map +1 -1
- package/out/dev-tools/us-recall-flip-census.run.js +7 -3
- package/out/dev-tools/us-recall-flip-census.run.js.map +1 -1
- package/out/doctor/checks.d.ts +105 -35
- package/out/doctor/checks.d.ts.map +1 -1
- package/out/doctor/checks.js +49 -19
- package/out/doctor/checks.js.map +1 -1
- package/out/doctor/runner.d.ts +51 -17
- package/out/doctor/runner.d.ts.map +1 -1
- package/out/doctor/runner.js +16 -8
- package/out/doctor/runner.js.map +1 -1
- package/out/eval-harness/baseline-assert.d.ts +57 -19
- package/out/eval-harness/baseline-assert.d.ts.map +1 -1
- package/out/eval-harness/baseline-assert.js +12 -4
- package/out/eval-harness/baseline-assert.js.map +1 -1
- package/out/eval-harness/capability-manifest.d.ts +24 -8
- package/out/eval-harness/capability-manifest.d.ts.map +1 -1
- package/out/eval-harness/capability-manifest.js +32 -24
- package/out/eval-harness/capability-manifest.js.map +1 -1
- package/out/eval-harness/digit-board.d.ts +6 -1
- package/out/eval-harness/digit-board.d.ts.map +1 -1
- package/out/eval-harness/digit-board.js +7 -4
- package/out/eval-harness/digit-board.js.map +1 -1
- package/out/eval-harness/error-analysis.d.ts +21 -7
- package/out/eval-harness/error-analysis.d.ts.map +1 -1
- package/out/eval-harness/error-analysis.js +4 -3
- package/out/eval-harness/error-analysis.js.map +1 -1
- package/out/eval-harness/es-postcode-centroids.d.ts +15 -5
- package/out/eval-harness/es-postcode-centroids.d.ts.map +1 -1
- package/out/eval-harness/es-postcode-centroids.js +3 -1
- package/out/eval-harness/es-postcode-centroids.js.map +1 -1
- package/out/eval-harness/fragment-board.d.ts +9 -2
- package/out/eval-harness/fragment-board.d.ts.map +1 -1
- package/out/eval-harness/fragment-board.js +10 -5
- package/out/eval-harness/fragment-board.js.map +1 -1
- package/out/eval-harness/fragment-dev.d.ts +6 -2
- package/out/eval-harness/fragment-dev.d.ts.map +1 -1
- package/out/eval-harness/fragment-dev.js +4 -2
- package/out/eval-harness/fragment-dev.js.map +1 -1
- package/out/eval-harness/gauntlet/build-fdic-holdout.d.ts +3 -1
- package/out/eval-harness/gauntlet/build-fdic-holdout.d.ts.map +1 -1
- package/out/eval-harness/gauntlet/build-fdic-holdout.js +40 -5
- package/out/eval-harness/gauntlet/build-fdic-holdout.js.map +1 -1
- package/out/eval-harness/gauntlet/build-regression-db.d.ts +3 -1
- package/out/eval-harness/gauntlet/build-regression-db.d.ts.map +1 -1
- package/out/eval-harness/gauntlet/build-regression-db.js +3 -1
- package/out/eval-harness/gauntlet/build-regression-db.js.map +1 -1
- package/out/eval-harness/gauntlet/cases/regression.d.ts +12 -3
- package/out/eval-harness/gauntlet/cases/regression.d.ts.map +1 -1
- package/out/eval-harness/gauntlet/cases/regression.js +33 -34
- package/out/eval-harness/gauntlet/cases/regression.js.map +1 -1
- package/out/eval-harness/gauntlet/harness.d.ts +12 -4
- package/out/eval-harness/gauntlet/harness.d.ts.map +1 -1
- package/out/eval-harness/gauntlet/harness.js.map +1 -1
- package/out/eval-harness/gauntlet/holdout.d.ts +15 -5
- package/out/eval-harness/gauntlet/holdout.d.ts.map +1 -1
- package/out/eval-harness/gauntlet/holdout.js +20 -5
- package/out/eval-harness/gauntlet/holdout.js.map +1 -1
- package/out/eval-harness/gauntlet/metamorphic.d.ts +3 -1
- package/out/eval-harness/gauntlet/metamorphic.d.ts.map +1 -1
- package/out/eval-harness/gauntlet/metamorphic.js +81 -39
- package/out/eval-harness/gauntlet/metamorphic.js.map +1 -1
- package/out/eval-harness/gauntlet/regression.d.ts +12 -4
- package/out/eval-harness/gauntlet/regression.d.ts.map +1 -1
- package/out/eval-harness/gauntlet/regression.js +9 -3
- package/out/eval-harness/gauntlet/regression.js.map +1 -1
- package/out/eval-harness/gauntlet/run.d.ts +21 -7
- package/out/eval-harness/gauntlet/run.d.ts.map +1 -1
- package/out/eval-harness/gauntlet/run.js +3 -1
- package/out/eval-harness/gauntlet/run.js.map +1 -1
- package/out/eval-harness/gauntlet/schema.d.ts +63 -21
- package/out/eval-harness/gauntlet/schema.d.ts.map +1 -1
- package/out/eval-harness/gauntlet/schema.js +6 -2
- package/out/eval-harness/gauntlet/schema.js.map +1 -1
- package/out/eval-harness/invariance/command.d.ts +12 -4
- package/out/eval-harness/invariance/command.d.ts.map +1 -1
- package/out/eval-harness/invariance/command.js +3 -1
- package/out/eval-harness/invariance/command.js.map +1 -1
- package/out/eval-harness/invariance/compare.d.ts +7 -1
- package/out/eval-harness/invariance/compare.d.ts.map +1 -1
- package/out/eval-harness/invariance/compare.js +10 -4
- package/out/eval-harness/invariance/compare.js.map +1 -1
- package/out/eval-harness/invariance/runner.d.ts +39 -12
- package/out/eval-harness/invariance/runner.d.ts.map +1 -1
- package/out/eval-harness/invariance/runner.js +19 -13
- package/out/eval-harness/invariance/runner.js.map +1 -1
- package/out/eval-harness/invariance/transforms.d.ts +16 -4
- package/out/eval-harness/invariance/transforms.d.ts.map +1 -1
- package/out/eval-harness/invariance/transforms.js +37 -31
- package/out/eval-harness/invariance/transforms.js.map +1 -1
- package/out/eval-harness/ledger-append.d.ts +30 -10
- package/out/eval-harness/ledger-append.d.ts.map +1 -1
- package/out/eval-harness/ledger-append.js +1 -1
- package/out/eval-harness/ledger-append.js.map +1 -1
- package/out/eval-harness/mask-regression.d.ts +30 -10
- package/out/eval-harness/mask-regression.d.ts.map +1 -1
- package/out/eval-harness/mask-regression.js +20 -10
- package/out/eval-harness/mask-regression.js.map +1 -1
- package/out/eval-harness/oa-resolver-eval.d.ts +121 -39
- package/out/eval-harness/oa-resolver-eval.d.ts.map +1 -1
- package/out/eval-harness/oa-resolver-eval.js +227 -217
- package/out/eval-harness/oa-resolver-eval.js.map +1 -1
- package/out/eval-harness/oa-resolver-report.d.ts +43 -0
- package/out/eval-harness/oa-resolver-report.d.ts.map +1 -0
- package/out/eval-harness/oa-resolver-report.js +109 -0
- package/out/eval-harness/oa-resolver-report.js.map +1 -0
- package/out/eval-harness/oracle-k.d.ts +21 -7
- package/out/eval-harness/oracle-k.d.ts.map +1 -1
- package/out/eval-harness/oracle-k.js +36 -20
- package/out/eval-harness/oracle-k.js.map +1 -1
- package/out/eval-harness/parity-corpus.d.ts +13 -10
- package/out/eval-harness/parity-corpus.d.ts.map +1 -1
- package/out/eval-harness/parity-corpus.js +27 -11
- package/out/eval-harness/parity-corpus.js.map +1 -1
- package/out/eval-harness/poi-board.d.ts +54 -17
- package/out/eval-harness/poi-board.d.ts.map +1 -1
- package/out/eval-harness/poi-board.js +17 -14
- package/out/eval-harness/poi-board.js.map +1 -1
- package/out/eval-harness/preset-compare.d.ts +12 -4
- package/out/eval-harness/preset-compare.d.ts.map +1 -1
- package/out/eval-harness/preset-compare.js +3 -1
- package/out/eval-harness/preset-compare.js.map +1 -1
- package/out/eval-harness/promotion-gate-verdict.d.ts +18 -6
- package/out/eval-harness/promotion-gate-verdict.d.ts.map +1 -1
- package/out/eval-harness/promotion-gate-verdict.js +7 -3
- package/out/eval-harness/promotion-gate-verdict.js.map +1 -1
- package/out/eval-harness/promotion-gate.d.ts +27 -9
- package/out/eval-harness/promotion-gate.d.ts.map +1 -1
- package/out/eval-harness/promotion-gate.js +55 -38
- package/out/eval-harness/promotion-gate.js.map +1 -1
- package/out/eval-harness/v0-tree-adapter.d.ts +3 -1
- package/out/eval-harness/v0-tree-adapter.d.ts.map +1 -1
- package/out/eval-harness/v0-tree-adapter.js +6 -4
- package/out/eval-harness/v0-tree-adapter.js.map +1 -1
- package/out/gazetteer-pipeline/admin/enrich.d.ts +6 -2
- package/out/gazetteer-pipeline/admin/enrich.d.ts.map +1 -1
- package/out/gazetteer-pipeline/admin/enrich.js +5 -2
- package/out/gazetteer-pipeline/admin/enrich.js.map +1 -1
- package/out/gazetteer-pipeline/admin/fold-geonames.d.ts +18 -6
- package/out/gazetteer-pipeline/admin/fold-geonames.d.ts.map +1 -1
- package/out/gazetteer-pipeline/admin/fold-geonames.js +5 -3
- package/out/gazetteer-pipeline/admin/fold-geonames.js.map +1 -1
- package/out/gazetteer-pipeline/admin/fold-overture.d.ts.map +1 -1
- package/out/gazetteer-pipeline/admin/fold-overture.js +2 -2
- package/out/gazetteer-pipeline/admin/fold-overture.js.map +1 -1
- package/out/gazetteer-pipeline/admin/freeze.d.ts +3 -1
- package/out/gazetteer-pipeline/admin/freeze.d.ts.map +1 -1
- package/out/gazetteer-pipeline/admin/freeze.js +4 -2
- package/out/gazetteer-pipeline/admin/freeze.js.map +1 -1
- package/out/gazetteer-pipeline/admin/index.d.ts +21 -7
- package/out/gazetteer-pipeline/admin/index.d.ts.map +1 -1
- package/out/gazetteer-pipeline/admin/index.js +6 -2
- package/out/gazetteer-pipeline/admin/index.js.map +1 -1
- package/out/gazetteer-pipeline/admin/ingest-wof.d.ts +18 -6
- package/out/gazetteer-pipeline/admin/ingest-wof.d.ts.map +1 -1
- package/out/gazetteer-pipeline/admin/ingest-wof.js +10 -4
- package/out/gazetteer-pipeline/admin/ingest-wof.js.map +1 -1
- package/out/gazetteer-pipeline/anchor-lookup.d.ts.map +1 -1
- package/out/gazetteer-pipeline/anchor-lookup.js +42 -17
- package/out/gazetteer-pipeline/anchor-lookup.js.map +1 -1
- package/out/gazetteer-pipeline/coverage-manifest.d.ts +65 -0
- package/out/gazetteer-pipeline/coverage-manifest.d.ts.map +1 -0
- package/out/gazetteer-pipeline/coverage-manifest.js +147 -0
- package/out/gazetteer-pipeline/coverage-manifest.js.map +1 -0
- package/out/gazetteer-pipeline/defaults.d.ts +15 -5
- package/out/gazetteer-pipeline/defaults.d.ts.map +1 -1
- package/out/gazetteer-pipeline/defaults.js +15 -5
- package/out/gazetteer-pipeline/defaults.js.map +1 -1
- package/out/gazetteer-pipeline/evidence-lexicons.d.ts +167 -0
- package/out/gazetteer-pipeline/evidence-lexicons.d.ts.map +1 -0
- package/out/gazetteer-pipeline/evidence-lexicons.js +462 -0
- package/out/gazetteer-pipeline/evidence-lexicons.js.map +1 -0
- package/out/gazetteer-pipeline/fst.d.ts +91 -0
- package/out/gazetteer-pipeline/fst.d.ts.map +1 -0
- package/out/gazetteer-pipeline/fst.js +233 -0
- package/out/gazetteer-pipeline/fst.js.map +1 -0
- package/out/gazetteer-pipeline/fts.d.ts +6 -2
- package/out/gazetteer-pipeline/fts.d.ts.map +1 -1
- package/out/gazetteer-pipeline/fts.js +3 -1
- package/out/gazetteer-pipeline/fts.js.map +1 -1
- package/out/gazetteer-pipeline/index.d.ts +60 -20
- package/out/gazetteer-pipeline/index.d.ts.map +1 -1
- package/out/gazetteer-pipeline/index.js +24 -6
- package/out/gazetteer-pipeline/index.js.map +1 -1
- package/out/gazetteer-pipeline/pair-index-hierarchy-probe.d.ts +89 -0
- package/out/gazetteer-pipeline/pair-index-hierarchy-probe.d.ts.map +1 -0
- package/out/gazetteer-pipeline/pair-index-hierarchy-probe.js +226 -0
- package/out/gazetteer-pipeline/pair-index-hierarchy-probe.js.map +1 -0
- package/out/gazetteer-pipeline/pair-index-hierarchy-verify.d.ts +31 -0
- package/out/gazetteer-pipeline/pair-index-hierarchy-verify.d.ts.map +1 -0
- package/out/gazetteer-pipeline/pair-index-hierarchy-verify.js +229 -0
- package/out/gazetteer-pipeline/pair-index-hierarchy-verify.js.map +1 -0
- package/out/gazetteer-pipeline/pair-index.d.ts +30 -10
- package/out/gazetteer-pipeline/pair-index.d.ts.map +1 -1
- package/out/gazetteer-pipeline/pair-index.js +13 -9
- package/out/gazetteer-pipeline/pair-index.js.map +1 -1
- package/out/gazetteer-pipeline/poi/build-brands.d.ts +27 -9
- package/out/gazetteer-pipeline/poi/build-brands.d.ts.map +1 -1
- package/out/gazetteer-pipeline/poi/build-brands.js +17 -7
- package/out/gazetteer-pipeline/poi/build-brands.js.map +1 -1
- package/out/gazetteer-pipeline/poi/build-poi.d.ts +60 -20
- package/out/gazetteer-pipeline/poi/build-poi.d.ts.map +1 -1
- package/out/gazetteer-pipeline/poi/build-poi.js +23 -9
- package/out/gazetteer-pipeline/poi/build-poi.js.map +1 -1
- package/out/gazetteer-pipeline/postcode/centroid-fills.d.ts +12 -4
- package/out/gazetteer-pipeline/postcode/centroid-fills.d.ts.map +1 -1
- package/out/gazetteer-pipeline/postcode/centroid-fills.js +8 -5
- package/out/gazetteer-pipeline/postcode/centroid-fills.js.map +1 -1
- package/out/gazetteer-pipeline/postcode/index.d.ts +21 -7
- package/out/gazetteer-pipeline/postcode/index.d.ts.map +1 -1
- package/out/gazetteer-pipeline/postcode/index.js +3 -1
- package/out/gazetteer-pipeline/postcode/index.js.map +1 -1
- package/out/gazetteer-pipeline/postcode/nl-pc6.d.ts +3 -1
- package/out/gazetteer-pipeline/postcode/nl-pc6.d.ts.map +1 -1
- package/out/gazetteer-pipeline/postcode/nl-pc6.js +3 -1
- package/out/gazetteer-pipeline/postcode/nl-pc6.js.map +1 -1
- package/out/gazetteer-pipeline/postcode/zcta-centroids.d.ts +3 -1
- package/out/gazetteer-pipeline/postcode/zcta-centroids.d.ts.map +1 -1
- package/out/gazetteer-pipeline/postcode/zcta-centroids.js +8 -2
- package/out/gazetteer-pipeline/postcode/zcta-centroids.js.map +1 -1
- package/out/gazetteer-pipeline/postcode-locality/base.d.ts.map +1 -1
- package/out/gazetteer-pipeline/postcode-locality/base.js +33 -22
- package/out/gazetteer-pipeline/postcode-locality/base.js.map +1 -1
- package/out/gazetteer-pipeline/postcode-locality/jp.d.ts.map +1 -1
- package/out/gazetteer-pipeline/postcode-locality/jp.js +43 -23
- package/out/gazetteer-pipeline/postcode-locality/jp.js.map +1 -1
- package/out/gazetteer-pipeline/postcode-locality/kr.d.ts.map +1 -1
- package/out/gazetteer-pipeline/postcode-locality/kr.js +33 -21
- package/out/gazetteer-pipeline/postcode-locality/kr.js.map +1 -1
- package/out/gazetteer-pipeline/postcode-locality/tw.d.ts +24 -8
- package/out/gazetteer-pipeline/postcode-locality/tw.d.ts.map +1 -1
- package/out/gazetteer-pipeline/postcode-locality/tw.js +68 -51
- package/out/gazetteer-pipeline/postcode-locality/tw.js.map +1 -1
- package/out/gazetteer-pipeline/street-morphology.d.ts +59 -0
- package/out/gazetteer-pipeline/street-morphology.d.ts.map +1 -0
- package/out/gazetteer-pipeline/street-morphology.js +65 -0
- package/out/gazetteer-pipeline/street-morphology.js.map +1 -0
- package/out/gazetteer-pipeline/verify-baseline.d.ts +4 -0
- package/out/gazetteer-pipeline/verify-baseline.d.ts.map +1 -1
- package/out/gazetteer-pipeline/verify-baseline.js +5 -1
- package/out/gazetteer-pipeline/verify-baseline.js.map +1 -1
- package/out/gazetteer-pipeline/verify.d.ts +9 -3
- package/out/gazetteer-pipeline/verify.d.ts.map +1 -1
- package/out/gazetteer-pipeline/verify.js +11 -5
- package/out/gazetteer-pipeline/verify.js.map +1 -1
- package/out/geocode-core.d.ts +56 -18
- package/out/geocode-core.d.ts.map +1 -1
- package/out/geocode-core.js +59 -29
- package/out/geocode-core.js.map +1 -1
- package/out/geocode-stream.d.ts +24 -8
- package/out/geocode-stream.d.ts.map +1 -1
- package/out/geocode-stream.js +3 -1
- package/out/geocode-stream.js.map +1 -1
- package/out/geocode-worker.d.ts +4 -0
- package/out/geocode-worker.d.ts.map +1 -1
- package/out/geocode-worker.js +4 -0
- package/out/geocode-worker.js.map +1 -1
- package/out/interp-calibration.d.ts +3 -1
- package/out/interp-calibration.d.ts.map +1 -1
- package/out/interp-calibration.js.map +1 -1
- package/out/kbest-street-rerank.d.ts +27 -11
- package/out/kbest-street-rerank.d.ts.map +1 -1
- package/out/kbest-street-rerank.js +11 -8
- package/out/kbest-street-rerank.js.map +1 -1
- package/out/poi-executor.d.ts +9 -3
- package/out/poi-executor.d.ts.map +1 -1
- package/out/poi-executor.js +5 -3
- package/out/poi-executor.js.map +1 -1
- package/out/poi-intent.d.ts +3 -1
- package/out/poi-intent.d.ts.map +1 -1
- package/out/poi-intent.js +5 -3
- package/out/poi-intent.js.map +1 -1
- package/out/region-recognition.d.ts.map +1 -1
- package/out/region-recognition.js +12 -6
- package/out/region-recognition.js.map +1 -1
- package/out/release-tools/publish-hf.d.ts +8 -2
- package/out/release-tools/publish-hf.d.ts.map +1 -1
- package/out/release-tools/publish-hf.js +78 -71
- package/out/release-tools/publish-hf.js.map +1 -1
- package/out/resolver-backend.d.ts.map +1 -1
- package/out/resolver-backend.js.map +1 -1
- package/out/runtime-pipeline.d.ts +9 -4
- package/out/runtime-pipeline.d.ts.map +1 -1
- package/out/runtime-pipeline.js +21 -15
- package/out/runtime-pipeline.js.map +1 -1
- package/out/test-kit/index.js +4 -4
- package/out/test-kit/index.js.map +1 -1
- package/out/tools/generate-clients.d.ts +12 -4
- package/out/tools/generate-clients.d.ts.map +1 -1
- package/out/tools/generate-clients.js +13 -5
- package/out/tools/generate-clients.js.map +1 -1
- package/package.json +23 -23
- package/poi-executor.ts +14 -6
- package/poi-intent.ts +6 -3
- package/region-recognition.ts +14 -6
- package/release-tools/publish-hf.ts +130 -84
- package/resolver-backend.ts +1 -0
- package/runtime-pipeline.ts +40 -20
- package/test-kit/index.ts +4 -4
- package/tools/generate-clients.ts +29 -8
package/api-engine.ts
CHANGED
|
@@ -34,6 +34,9 @@ import { recordTimed } from "@mailwoman/api-kit"
|
|
|
34
34
|
import { decodeAsTuples, decodeAsXML } from "@mailwoman/core"
|
|
35
35
|
import type { AddressTree } from "@mailwoman/core/decoder"
|
|
36
36
|
import { $public } from "@mailwoman/core/env"
|
|
37
|
+
import { deriveInputMode } from "@mailwoman/core/pipeline"
|
|
38
|
+
import { classifyKindSync } from "@mailwoman/kind-classifier"
|
|
39
|
+
import { computeQueryShape } from "@mailwoman/query-shape"
|
|
37
40
|
import { createWOFResolver, type Resolver, type ResolveOpts } from "@mailwoman/resolver"
|
|
38
41
|
|
|
39
42
|
import { readReleaseManifest } from "./data-release.ts"
|
|
@@ -47,10 +50,14 @@ import {
|
|
|
47
50
|
import { INTERP_RADIUS_CALIBRATION, interpCalibrationForRegion } from "./interp-calibration.ts"
|
|
48
51
|
import { createResolverBackend, mailwomanDataRoot, resolveCandidateDBPath, wofShardPaths } from "./resolver-backend.ts"
|
|
49
52
|
|
|
50
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* Default per-state shard root + interp calibration — mirrors the express server's defaults (`GeocodeRouter.ts`).
|
|
55
|
+
*/
|
|
51
56
|
const DATA_ROOT = mailwomanDataRoot()
|
|
52
57
|
|
|
53
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* The classifier/resolver/shard bundle `geocode`/`batch`/`resolveTree`/`reload` close over.
|
|
60
|
+
*/
|
|
54
61
|
interface GeocodeDepsBundle {
|
|
55
62
|
classifier: GeocodeClassifier
|
|
56
63
|
resolver: Resolver
|
|
@@ -58,7 +65,9 @@ interface GeocodeDepsBundle {
|
|
|
58
65
|
defaultCountry?: string
|
|
59
66
|
}
|
|
60
67
|
|
|
61
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Same WOF-path resolution as the express `GeocodeRouter`/`HealthRouter` (env override, else the conventional shards).
|
|
70
|
+
*/
|
|
62
71
|
function wofPaths(): string[] {
|
|
63
72
|
const env = $public.MAILWOMAN_WOF_DB
|
|
64
73
|
|
|
@@ -115,6 +124,7 @@ function readModelCard(): Record<string, unknown> | null {
|
|
|
115
124
|
} catch {
|
|
116
125
|
/* package not resolvable from here — fall through */
|
|
117
126
|
}
|
|
127
|
+
|
|
118
128
|
candidates.push("neural-weights-en-us/model-card.json")
|
|
119
129
|
|
|
120
130
|
for (const p of candidates) {
|
|
@@ -172,18 +182,27 @@ function buildHealthData(): HealthData {
|
|
|
172
182
|
}
|
|
173
183
|
}
|
|
174
184
|
|
|
175
|
-
/**
|
|
176
|
-
|
|
185
|
+
/**
|
|
186
|
+
* One geocode call over the shared deps. Ported from `GeocodeRouter`'s `oneGeocode`.
|
|
187
|
+
*/
|
|
188
|
+
function oneGeocode(
|
|
189
|
+
deps: GeocodeDepsBundle,
|
|
190
|
+
address: string,
|
|
191
|
+
inputMode?: "fragmented" | "formatted"
|
|
192
|
+
): Promise<GeocodeResult> {
|
|
177
193
|
return geocodeAddress(address, {
|
|
178
194
|
classifier: deps.classifier,
|
|
179
195
|
resolver: deps.resolver,
|
|
180
196
|
shards: deps.shards.for,
|
|
181
197
|
defaultCountry: deps.defaultCountry,
|
|
182
198
|
interpCalibration: INTERP_RADIUS_CALIBRATION,
|
|
199
|
+
inputMode,
|
|
183
200
|
})
|
|
184
201
|
}
|
|
185
202
|
|
|
186
|
-
/**
|
|
203
|
+
/**
|
|
204
|
+
* Pull the street node's resolution tier (if any) for the metric. Ported verbatim from `GeocodeRouter`.
|
|
205
|
+
*/
|
|
187
206
|
function collectStreetTier(
|
|
188
207
|
node: AddressTree["roots"][number]
|
|
189
208
|
): Array<"address_point" | "interpolated" | "street" | "admin"> {
|
|
@@ -204,7 +223,9 @@ function collectStreetTier(
|
|
|
204
223
|
return out
|
|
205
224
|
}
|
|
206
225
|
|
|
207
|
-
/**
|
|
226
|
+
/**
|
|
227
|
+
* {@link createServeEngine}'s return value.
|
|
228
|
+
*/
|
|
208
229
|
export interface ServeEngine {
|
|
209
230
|
engine: MailwomanAPIEngine
|
|
210
231
|
preflight: { ok: true } | { ok: false; message: string }
|
|
@@ -232,8 +253,16 @@ export async function createServeEngine(): Promise<ServeEngine> {
|
|
|
232
253
|
classifier = await neuralMod.NeuralAddressClassifier.loadFromWeights({ locale: "en-US" })
|
|
233
254
|
|
|
234
255
|
const parseClassifier = classifier
|
|
256
|
+
|
|
235
257
|
parse = async (address, opts) => {
|
|
236
|
-
|
|
258
|
+
// Decision A: explicit wire register wins; unset → the kind classifier decides (same derivation
|
|
259
|
+
// as the runtime pipeline / geocode-core — /v1/parse is the "plain parse" endpoint class).
|
|
260
|
+
const shape = computeQueryShape(address)
|
|
261
|
+
|
|
262
|
+
const inputMode =
|
|
263
|
+
opts.inputMode ?? deriveInputMode(classifyKindSync({ raw: address, normalized: address }, shape).kind)
|
|
264
|
+
|
|
265
|
+
const tree = await parseClassifier.parse(address, { postcodeRepair: true, inputMode })
|
|
237
266
|
|
|
238
267
|
return {
|
|
239
268
|
input: address,
|
|
@@ -271,7 +300,7 @@ export async function createServeEngine(): Promise<ServeEngine> {
|
|
|
271
300
|
// This gate governs geocode/batch/resolveTree/reload ONLY — `parse` is already wired above and unaffected.
|
|
272
301
|
const candidateDb = resolveCandidateDBPath()
|
|
273
302
|
|
|
274
|
-
if (paths.length
|
|
303
|
+
if (!paths.length && !candidateDb) {
|
|
275
304
|
console.error("createServeEngine: no WOF DBs found — set MAILWOMAN_WOF_DB or MAILWOMAN_CANDIDATE_DB")
|
|
276
305
|
|
|
277
306
|
return { engine: { parse, health }, preflight: { ok: false, message: buildPreflightMessage() } }
|
|
@@ -285,8 +314,8 @@ export async function createServeEngine(): Promise<ServeEngine> {
|
|
|
285
314
|
// Route records the whole-call metric already (`@mailwoman/api`'s `routes.ts`) — the engine records nothing extra
|
|
286
315
|
// here. Ported from `GeocodeRouter`'s `singleHandler`. The cast mirrors `@mailwoman/api/routes.ts`'s established
|
|
287
316
|
// "documented wire shape looser than the domain type" idiom — `GeocodeOutcome` is a deliberately loose passthrough.
|
|
288
|
-
const geocode: MailwomanAPIEngine["geocode"] = async (address) =>
|
|
289
|
-
(await oneGeocode(deps, address)) as unknown as GeocodeOutcome
|
|
317
|
+
const geocode: MailwomanAPIEngine["geocode"] = async (address, opts) =>
|
|
318
|
+
(await oneGeocode(deps, address, opts?.inputMode)) as unknown as GeocodeOutcome
|
|
290
319
|
|
|
291
320
|
// Sequential loop — results land in input order; a thrown row is isolated to its own
|
|
292
321
|
// `{ input, error }` slot. Rows are trimmed here (the route passes the raw validated array through).
|
|
@@ -297,7 +326,9 @@ export async function createServeEngine(): Promise<ServeEngine> {
|
|
|
297
326
|
// and `node:sqlite` reads are synchronous. The pool bought nothing but the appearance of tuning, so
|
|
298
327
|
// it's a plain loop now. To actually parallelize, cross a thread boundary — see
|
|
299
328
|
// `mailwoman/geocode-stream.ts`. Receipts: `docs/articles/plan/reference/performance.mdx`.
|
|
300
|
-
const batch: MailwomanAPIEngine["batch"] = async (addresses) => {
|
|
329
|
+
const batch: MailwomanAPIEngine["batch"] = async (addresses, opts) => {
|
|
330
|
+
// Decision A endpoint default: batch rows are the record register.
|
|
331
|
+
const inputMode = opts?.inputMode ?? "formatted"
|
|
301
332
|
const inputs = addresses.map((a) => a.trim())
|
|
302
333
|
const results: BatchRow[] = new Array<BatchRow>(inputs.length)
|
|
303
334
|
|
|
@@ -306,12 +337,12 @@ export async function createServeEngine(): Promise<ServeEngine> {
|
|
|
306
337
|
const t0 = performance.now()
|
|
307
338
|
|
|
308
339
|
try {
|
|
309
|
-
const result = await oneGeocode(deps, input)
|
|
340
|
+
const result = await oneGeocode(deps, input, inputMode)
|
|
310
341
|
recordTimed(performance.now() - t0, result.resolution_tier)
|
|
311
342
|
results[i] = result as unknown as GeocodeOutcome
|
|
312
|
-
} catch (
|
|
343
|
+
} catch (error) {
|
|
313
344
|
recordTimed(performance.now() - t0, "error")
|
|
314
|
-
results[i] = { input, error:
|
|
345
|
+
results[i] = { input, error: error instanceof Error ? error.message : String(error) }
|
|
315
346
|
}
|
|
316
347
|
}
|
|
317
348
|
|
|
@@ -328,19 +359,25 @@ export async function createServeEngine(): Promise<ServeEngine> {
|
|
|
328
359
|
try {
|
|
329
360
|
const slug = regionSlugFromTree(tree)
|
|
330
361
|
const { addressPoints, interpolation } = deps.shards.for(slug)
|
|
362
|
+
|
|
331
363
|
const opts: ResolveOpts = {
|
|
332
364
|
...incomingOpts,
|
|
333
365
|
defaultCountry: incomingOpts.defaultCountry ?? deps.defaultCountry,
|
|
334
366
|
...(addressPoints ? { addressPoints } : {}),
|
|
367
|
+
// #374 calibration ladder: explicit incoming factor (instrument override, survives the spread) →
|
|
368
|
+
// the artifact's own header value (`interpolation.radiusCalibration`, read at shard open — the
|
|
369
|
+
// resolver consumes it directly, nothing passed here) → the in-code per-region table for shards
|
|
370
|
+
// predating the `interp_calibration` metadata table.
|
|
335
371
|
...(interpolation
|
|
336
372
|
? {
|
|
337
373
|
interpolation,
|
|
338
|
-
interpolationRadiusCalibration
|
|
339
|
-
|
|
340
|
-
|
|
374
|
+
...(incomingOpts.interpolationRadiusCalibration == null && interpolation.radiusCalibration == null
|
|
375
|
+
? { interpolationRadiusCalibration: interpCalibrationForRegion(INTERP_RADIUS_CALIBRATION, slug) }
|
|
376
|
+
: {}),
|
|
341
377
|
}
|
|
342
378
|
: {}),
|
|
343
379
|
}
|
|
380
|
+
|
|
344
381
|
const resolved = await deps.resolver.resolveTree(tree, opts)
|
|
345
382
|
// Best-effort tier metric: read the street node's stamped tier (matches the geocode path).
|
|
346
383
|
const street = resolved.roots.flatMap((r) => collectStreetTier(r)).find(Boolean)
|
|
@@ -349,9 +386,9 @@ export async function createServeEngine(): Promise<ServeEngine> {
|
|
|
349
386
|
const outcome: ResolveTreeOutcome = { tree: resolved }
|
|
350
387
|
|
|
351
388
|
return outcome
|
|
352
|
-
} catch (
|
|
389
|
+
} catch (error) {
|
|
353
390
|
recordTimed(performance.now() - t0, "error")
|
|
354
|
-
throw
|
|
391
|
+
throw error
|
|
355
392
|
}
|
|
356
393
|
}
|
|
357
394
|
|
package/cli-kit/index.ts
CHANGED
|
@@ -18,7 +18,7 @@ import type * as zod from "zod"
|
|
|
18
18
|
/**
|
|
19
19
|
* Type-helper to infer the positional arguments of a command.
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
21
|
+
export interface PositionalArguments<T extends zod.ZodTypeAny> {
|
|
22
22
|
args: zod.infer<T>
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -30,10 +30,10 @@ export type PositionalCommandComponent<T extends zod.ZodTypeAny> = React.FC<Posi
|
|
|
30
30
|
/**
|
|
31
31
|
* Type-helper to infer the options of a command.
|
|
32
32
|
*/
|
|
33
|
-
export
|
|
33
|
+
export interface CommandProps<
|
|
34
34
|
OptionProps extends zod.ZodObject,
|
|
35
35
|
PositionalProps extends zod.ZodTypeAny | unknown = unknown,
|
|
36
|
-
>
|
|
36
|
+
> {
|
|
37
37
|
options: zod.infer<OptionProps>
|
|
38
38
|
args: PositionalProps extends zod.ZodTypeAny ? zod.infer<PositionalProps> : unknown[]
|
|
39
39
|
}
|
|
@@ -46,7 +46,9 @@ export type CommandComponent<
|
|
|
46
46
|
PositionalProps extends zod.ZodTypeAny | unknown = unknown,
|
|
47
47
|
> = React.FC<CommandProps<OptionProps, PositionalProps>>
|
|
48
48
|
|
|
49
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* The lifecycle of a command's one-shot async task.
|
|
51
|
+
*/
|
|
50
52
|
export type CommandTaskState<T> =
|
|
51
53
|
| { status: "running" }
|
|
52
54
|
| { status: "done"; result: T }
|
|
@@ -79,6 +81,7 @@ export function useCommandTask<T>(task: () => Promise<T>, exitCode?: (result: T)
|
|
|
79
81
|
|
|
80
82
|
return state
|
|
81
83
|
}
|
|
84
|
+
|
|
82
85
|
/* oxlint-enable react-hooks/exhaustive-deps */
|
|
83
86
|
|
|
84
87
|
/**
|
|
@@ -93,7 +96,9 @@ export function commandError(message: string): Error {
|
|
|
93
96
|
return error
|
|
94
97
|
}
|
|
95
98
|
|
|
96
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* One ✓/✗ line in a {@linkcode CheckList}.
|
|
101
|
+
*/
|
|
97
102
|
export interface Check {
|
|
98
103
|
ok: boolean
|
|
99
104
|
check: string
|
|
@@ -112,6 +117,7 @@ export function CheckList({ checks, verdict }: { checks: readonly Check[]; verdi
|
|
|
112
117
|
`${c.ok ? "✓" : "✗"} ${c.check}${c.detail ? `: ${c.detail}` : ""}`
|
|
113
118
|
)
|
|
114
119
|
)
|
|
120
|
+
|
|
115
121
|
const summary =
|
|
116
122
|
verdict === undefined
|
|
117
123
|
? null
|
|
@@ -29,10 +29,14 @@ import { resolveWeights, weightsCacheDir, weightsPackageName } from "@mailwoman/
|
|
|
29
29
|
import { Box, Text, useInput, useStdin } from "ink"
|
|
30
30
|
import React, { useEffect, useState } from "react"
|
|
31
31
|
|
|
32
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* How the guard resolved, handed to the render prop.
|
|
34
|
+
*/
|
|
33
35
|
export type WeightsOutcome = "neural" | "declined" | "unavailable"
|
|
34
36
|
|
|
35
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Probe whether weights resolve for a locale without loading the model. Cheap (fs checks only).
|
|
39
|
+
*/
|
|
36
40
|
export function probeWeights(locale?: string, cacheRoot?: string): { ok: boolean; detail?: string } {
|
|
37
41
|
try {
|
|
38
42
|
resolveWeights({ locale, ...(cacheRoot ? { cacheRoot } : {}) })
|
|
@@ -43,7 +47,9 @@ export function probeWeights(locale?: string, cacheRoot?: string): { ok: boolean
|
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
49
|
|
|
46
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* The npm invocation that populates the weights cache. Pure — unit-tested; `spec` defaults to `latest`.
|
|
52
|
+
*/
|
|
47
53
|
export function buildWeightsInstallArgs(locale: string | undefined, cacheRoot: string, spec = "latest"): string[] {
|
|
48
54
|
return [
|
|
49
55
|
"install",
|
|
@@ -117,15 +123,25 @@ export function downloadWeights(
|
|
|
117
123
|
}
|
|
118
124
|
|
|
119
125
|
export interface WeightsGuardProps {
|
|
120
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* Locale whose weights package guards this command (defaults to en-US resolution rules).
|
|
128
|
+
*/
|
|
121
129
|
locale?: string
|
|
122
|
-
/**
|
|
130
|
+
/**
|
|
131
|
+
* `--download-weights`: skip the prompt, download immediately.
|
|
132
|
+
*/
|
|
123
133
|
autoDownload?: boolean
|
|
124
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* `--degraded`: skip the prompt, hand the caller the declined outcome directly.
|
|
136
|
+
*/
|
|
125
137
|
forceDegraded?: boolean
|
|
126
|
-
/**
|
|
138
|
+
/**
|
|
139
|
+
* Test seam / non-default cache root.
|
|
140
|
+
*/
|
|
127
141
|
cacheRoot?: string
|
|
128
|
-
/**
|
|
142
|
+
/**
|
|
143
|
+
* Renders once the guard settles.
|
|
144
|
+
*/
|
|
129
145
|
children: (outcome: WeightsOutcome) => React.ReactElement
|
|
130
146
|
}
|
|
131
147
|
|
|
@@ -27,6 +27,9 @@ export { ArgumentsSchema as args, AutocompleteConfigSchema as options }
|
|
|
27
27
|
|
|
28
28
|
const ArgumentsSchema = zod.array(zod.string().describe("Prefix string to complete"))
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Config accepted by `mailwoman autocomplete`, validated before the server starts so a bad flag fails fast.
|
|
32
|
+
*/
|
|
30
33
|
export const AutocompleteConfigSchema = zod.object({
|
|
31
34
|
limit: zod.coerce
|
|
32
35
|
.number()
|
|
@@ -46,7 +49,9 @@ export const AutocompleteConfigSchema = zod.object({
|
|
|
46
49
|
json: zod.boolean().optional().default(false).describe("Emit results as a JSON array instead of formatted text"),
|
|
47
50
|
})
|
|
48
51
|
|
|
49
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Resolve the FST binary path from explicit flag, env var, or the staged default.
|
|
54
|
+
*/
|
|
50
55
|
export function resolveFSTPath(explicitPath?: string): string {
|
|
51
56
|
return explicitPath ?? $public.MAILWOMAN_FST_BIN ?? "/tmp/v440-stage/en-us/v4.4.0/fst-en-US.bin"
|
|
52
57
|
}
|
|
@@ -82,8 +87,8 @@ export async function runAutocomplete(
|
|
|
82
87
|
|
|
83
88
|
try {
|
|
84
89
|
buf = readFileSync(fstPath)
|
|
85
|
-
} catch (
|
|
86
|
-
const msg =
|
|
90
|
+
} catch (error) {
|
|
91
|
+
const msg = error instanceof Error ? error.message : String(error)
|
|
87
92
|
throw commandError(`Failed to read FST binary at ${fstPath}: ${msg}`)
|
|
88
93
|
}
|
|
89
94
|
|
|
@@ -96,8 +101,8 @@ export async function runAutocomplete(
|
|
|
96
101
|
|
|
97
102
|
try {
|
|
98
103
|
matcher = deserializeFST(buf)
|
|
99
|
-
} catch (
|
|
100
|
-
const msg =
|
|
104
|
+
} catch (error) {
|
|
105
|
+
const msg = error instanceof Error ? error.message : String(error)
|
|
101
106
|
throw commandError(`Malformed FST binary at ${fstPath}: ${msg}`)
|
|
102
107
|
}
|
|
103
108
|
|
|
@@ -113,11 +118,11 @@ export async function runAutocomplete(
|
|
|
113
118
|
}
|
|
114
119
|
|
|
115
120
|
function formatSuggestions(entries: AutocompleteEntry[]): string {
|
|
116
|
-
if (entries.length
|
|
121
|
+
if (!entries.length) return "(no completions)"
|
|
117
122
|
|
|
118
123
|
return entries
|
|
119
124
|
.map((e, i) => {
|
|
120
|
-
const completion = e.completionTokens.length
|
|
125
|
+
const completion = e.completionTokens.length ? ` [+${e.completionTokens.join(" ")}]` : ""
|
|
121
126
|
const imp = e.importance.toFixed(4)
|
|
122
127
|
|
|
123
128
|
return `${String(i + 1).padStart(2)}. ${e.name}${completion} (${e.placetype}, wof:${e.wofID}, imp:${imp})`
|
|
@@ -23,6 +23,7 @@ export { OptionsSchema as options }
|
|
|
23
23
|
const Cmd: CommandComponent<typeof OptionsSchema> = ({ options }) => {
|
|
24
24
|
const state = useCommandTask(async () => {
|
|
25
25
|
const { alignCanonicalShard } = await import("@mailwoman/corpus/tools")
|
|
26
|
+
|
|
26
27
|
await alignCanonicalShard({
|
|
27
28
|
input: options.input,
|
|
28
29
|
output: options.output,
|
|
@@ -14,7 +14,7 @@ import zod from "zod"
|
|
|
14
14
|
|
|
15
15
|
import { type CommandComponent, useCommandTask } from "../../cli-kit/index.ts"
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
const ArgsSchema = zod.tuple([
|
|
18
18
|
zod.string().describe(
|
|
19
19
|
argument({
|
|
20
20
|
name: "corpus-dir",
|
|
@@ -28,9 +28,9 @@ const OptionsSchema = zod.object({
|
|
|
28
28
|
sample: zod.number().default(100).describe("Max shards sampled per split when scanning without a MANIFEST"),
|
|
29
29
|
})
|
|
30
30
|
|
|
31
|
-
export { OptionsSchema as options }
|
|
31
|
+
export { ArgsSchema as args, OptionsSchema as options }
|
|
32
32
|
|
|
33
|
-
const CorpusAudit: CommandComponent<typeof OptionsSchema, typeof
|
|
33
|
+
const CorpusAudit: CommandComponent<typeof OptionsSchema, typeof ArgsSchema> = ({ options, args }) => {
|
|
34
34
|
const state = useCommandTask(async () => {
|
|
35
35
|
audit({ corpusDir: args[0], configPath: options.config, sampleShardCount: options.sample })
|
|
36
36
|
})
|
|
@@ -40,6 +40,7 @@ const AdapterInputSchema = zod.union([
|
|
|
40
40
|
limit: zod.number().int().positive().optional(),
|
|
41
41
|
}),
|
|
42
42
|
])
|
|
43
|
+
|
|
43
44
|
const InputsSchema = zod.record(zod.string(), AdapterInputSchema)
|
|
44
45
|
|
|
45
46
|
const BuildConfigSchema = zod.object({
|
|
@@ -66,13 +67,14 @@ export { BuildConfigSchema as options }
|
|
|
66
67
|
|
|
67
68
|
const CorpusBuild: CommandComponent<typeof BuildConfigSchema> = ({ options }) => {
|
|
68
69
|
const [stage, setStage] = useState<{ name: BuildStage; message: string }>()
|
|
70
|
+
|
|
69
71
|
const state = useCommandTask(async () => {
|
|
70
72
|
let inputsParsed: Record<string, zod.infer<typeof AdapterInputSchema>>
|
|
71
73
|
|
|
72
74
|
try {
|
|
73
75
|
inputsParsed = InputsSchema.parse(JSON.parse(options.inputs))
|
|
74
|
-
} catch (
|
|
75
|
-
throw commandError(`invalid --inputs JSON: ${(
|
|
76
|
+
} catch (error) {
|
|
77
|
+
throw commandError(`invalid --inputs JSON: ${(error as Error).message}`)
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
const adapterInputs: Record<string, AdapterOptions> = Object.fromEntries(
|
|
@@ -80,6 +82,7 @@ const CorpusBuild: CommandComponent<typeof BuildConfigSchema> = ({ options }) =>
|
|
|
80
82
|
)
|
|
81
83
|
|
|
82
84
|
const adapters = defaultAdapterRegistry.list()
|
|
85
|
+
|
|
83
86
|
const m = await buildCorpus({
|
|
84
87
|
outputDir: options.output,
|
|
85
88
|
corpusVersion: options.corpusVersion,
|
|
@@ -33,7 +33,11 @@ const OptionsSchema = zod.object({
|
|
|
33
33
|
|
|
34
34
|
export { OptionsSchema as options }
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
interface Step {
|
|
37
|
+
label: string
|
|
38
|
+
status: "pending" | "running" | "done" | "error"
|
|
39
|
+
detail?: string
|
|
40
|
+
}
|
|
37
41
|
|
|
38
42
|
const CorpusDownload: CommandComponent<typeof OptionsSchema> = ({ options }) => {
|
|
39
43
|
const [steps, setSteps] = useState<Step[]>([
|
|
@@ -58,9 +62,9 @@ const CorpusDownload: CommandComponent<typeof OptionsSchema> = ({ options }) =>
|
|
|
58
62
|
try {
|
|
59
63
|
await $`rclone sync ${rcloneBase}/corpus/v0.3.0/ ${out}/corpus/versioned/v0.3.0/corpus-v0.3.0/ --progress --transfers 8 --checkers 16 ${dryFlag}`.quiet()
|
|
60
64
|
updateStep(0, { status: "done" })
|
|
61
|
-
} catch (
|
|
62
|
-
const e =
|
|
63
|
-
updateStep(0, { status: "error", detail: String(e.stderr ?? e.message ??
|
|
65
|
+
} catch (error: unknown) {
|
|
66
|
+
const e = error as Record<string, unknown>
|
|
67
|
+
updateStep(0, { status: "error", detail: String(e.stderr ?? e.message ?? error).slice(0, 100) })
|
|
64
68
|
|
|
65
69
|
return
|
|
66
70
|
}
|
|
@@ -71,9 +75,9 @@ const CorpusDownload: CommandComponent<typeof OptionsSchema> = ({ options }) =>
|
|
|
71
75
|
try {
|
|
72
76
|
await $`rclone sync ${rcloneBase}/corpus/v0.4.0/ ${out}/corpus/versioned/v0.4.0/corpus-v0.4.0/ --progress --transfers 4 ${dryFlag}`.quiet()
|
|
73
77
|
updateStep(1, { status: "done" })
|
|
74
|
-
} catch (
|
|
75
|
-
const e =
|
|
76
|
-
updateStep(1, { status: "error", detail: String(e.stderr ?? e.message ??
|
|
78
|
+
} catch (error: unknown) {
|
|
79
|
+
const e = error as Record<string, unknown>
|
|
80
|
+
updateStep(1, { status: "error", detail: String(e.stderr ?? e.message ?? error).slice(0, 100) })
|
|
77
81
|
|
|
78
82
|
return
|
|
79
83
|
}
|
|
@@ -84,9 +88,9 @@ const CorpusDownload: CommandComponent<typeof OptionsSchema> = ({ options }) =>
|
|
|
84
88
|
try {
|
|
85
89
|
await $`rclone sync ${rcloneBase}/models/tokenizer/ ${out}/models/tokenizer/ --progress ${dryFlag}`.quiet()
|
|
86
90
|
updateStep(2, { status: "done" })
|
|
87
|
-
} catch (
|
|
88
|
-
const e =
|
|
89
|
-
updateStep(2, { status: "error", detail: String(e.stderr ?? e.message ??
|
|
91
|
+
} catch (error: unknown) {
|
|
92
|
+
const e = error as Record<string, unknown>
|
|
93
|
+
updateStep(2, { status: "error", detail: String(e.stderr ?? e.message ?? error).slice(0, 100) })
|
|
90
94
|
|
|
91
95
|
return
|
|
92
96
|
}
|
|
@@ -97,11 +101,9 @@ const CorpusDownload: CommandComponent<typeof OptionsSchema> = ({ options }) =>
|
|
|
97
101
|
try {
|
|
98
102
|
await $`rclone sync ${rcloneBase}/corpus-python/ ./corpus-python/ --progress ${dryFlag}`.quiet()
|
|
99
103
|
updateStep(3, { status: "done" })
|
|
100
|
-
} catch (
|
|
101
|
-
const e =
|
|
102
|
-
updateStep(3, { status: "error", detail: String(e.stderr ?? e.message ??
|
|
103
|
-
|
|
104
|
-
return
|
|
104
|
+
} catch (error: unknown) {
|
|
105
|
+
const e = error as Record<string, unknown>
|
|
106
|
+
updateStep(3, { status: "error", detail: String(e.stderr ?? e.message ?? error).slice(0, 100) })
|
|
105
107
|
}
|
|
106
108
|
})
|
|
107
109
|
|
|
@@ -27,7 +27,7 @@ import zod from "zod"
|
|
|
27
27
|
|
|
28
28
|
import { type CommandComponent, useCommandTask } from "../../cli-kit/index.ts"
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
const ArgsSchema = zod.tuple([
|
|
31
31
|
zod
|
|
32
32
|
.enum([
|
|
33
33
|
"ban",
|
|
@@ -73,7 +73,7 @@ const OptionsSchema = zod.object({
|
|
|
73
73
|
dryRun: zod.boolean().default(false).describe("tiger-full: print planned downloads without fetching"),
|
|
74
74
|
})
|
|
75
75
|
|
|
76
|
-
export { OptionsSchema as options }
|
|
76
|
+
export { ArgsSchema as args, OptionsSchema as options }
|
|
77
77
|
|
|
78
78
|
type Options = zod.infer<typeof OptionsSchema>
|
|
79
79
|
|
|
@@ -125,7 +125,7 @@ function runSource(source: FetchSourceID, options: Options): Promise<FetchSummar
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
const CorpusFetch: CommandComponent<typeof OptionsSchema, typeof
|
|
128
|
+
const CorpusFetch: CommandComponent<typeof OptionsSchema, typeof ArgsSchema> = ({ options, args }) => {
|
|
129
129
|
const state = useCommandTask(
|
|
130
130
|
() => runSource(args[0], options),
|
|
131
131
|
(summary) => (summary.failed > 0 ? 1 : 0)
|
|
@@ -139,7 +139,7 @@ const CorpusFetch: CommandComponent<typeof OptionsSchema, typeof args> = ({ opti
|
|
|
139
139
|
return (
|
|
140
140
|
<Text color={failed > 0 ? "red" : "green"}>
|
|
141
141
|
{args[0]}: fetched {fetched}, skipped {skipped}, failed {failed}
|
|
142
|
-
{failedCodes.length
|
|
142
|
+
{failedCodes.length ? ` (${failedCodes.join(" ")})` : ""}
|
|
143
143
|
</Text>
|
|
144
144
|
)
|
|
145
145
|
}
|
package/commands/corpus/list.tsx
CHANGED
|
@@ -27,6 +27,7 @@ export { OptionsSchema as options }
|
|
|
27
27
|
const Cmd: CommandComponent<typeof OptionsSchema> = ({ options }) => {
|
|
28
28
|
const state = useCommandTask(async () => {
|
|
29
29
|
const { assembleOverlayManifest } = await import("@mailwoman/corpus/tools")
|
|
30
|
+
|
|
30
31
|
await assembleOverlayManifest({
|
|
31
32
|
base: options.base,
|
|
32
33
|
newDir: options.newDir,
|
package/commands/corpus/run.tsx
CHANGED
|
@@ -44,7 +44,7 @@ const RunConfigSchema = zod.object({
|
|
|
44
44
|
.int()
|
|
45
45
|
.positive()
|
|
46
46
|
.optional()
|
|
47
|
-
.default(
|
|
47
|
+
.default(1000)
|
|
48
48
|
.describe("Yield count between progress ticks (smaller = chattier, larger = quieter)"),
|
|
49
49
|
})
|
|
50
50
|
|
|
@@ -56,6 +56,7 @@ const CorpusRun: CommandComponent<typeof RunConfigSchema, typeof ArgumentsSchema
|
|
|
56
56
|
written: 0,
|
|
57
57
|
bytes: 0,
|
|
58
58
|
})
|
|
59
|
+
|
|
59
60
|
const state = useCommandTask(async () => {
|
|
60
61
|
const adapterID = args[0]
|
|
61
62
|
|
|
@@ -67,7 +68,7 @@ const CorpusRun: CommandComponent<typeof RunConfigSchema, typeof ArgumentsSchema
|
|
|
67
68
|
|
|
68
69
|
if (!adapter) {
|
|
69
70
|
const ids = defaultAdapterRegistry.ids()
|
|
70
|
-
const hint = ids.length
|
|
71
|
+
const hint = !ids.length ? "(no adapters registered yet)" : `registered: ${ids.join(", ")}`
|
|
71
72
|
throw commandError(`unknown adapter id ${JSON.stringify(adapterID)}; ${hint}`)
|
|
72
73
|
}
|
|
73
74
|
|
|
@@ -19,7 +19,9 @@ import zod from "zod"
|
|
|
19
19
|
|
|
20
20
|
import { type CommandComponent, commandError, useCommandTask } from "../../../cli-kit/index.ts"
|
|
21
21
|
|
|
22
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Bare `mailwoman corpus shard` stays the recipe runner now that `shard/` hosts subcommands.
|
|
24
|
+
*/
|
|
23
25
|
export const isDefault = true
|
|
24
26
|
|
|
25
27
|
const ArgumentsSchema = zod
|
|
@@ -70,7 +72,7 @@ const num = (s: string | undefined): number | undefined => (s == null ? undefine
|
|
|
70
72
|
|
|
71
73
|
const CorpusShard: CommandComponent<typeof OptionsSchema, typeof ArgumentsSchema> = ({ options, args }) => {
|
|
72
74
|
const state = useCommandTask(async () => {
|
|
73
|
-
if (options.list || args.length
|
|
75
|
+
if (options.list || !args.length) {
|
|
74
76
|
return [
|
|
75
77
|
"recipes:",
|
|
76
78
|
...listShardRecipes().map((r) => ` ${r.name.padEnd(20)} [${r.mode}] ${r.description}`),
|
|
@@ -93,6 +95,7 @@ const CorpusShard: CommandComponent<typeof OptionsSchema, typeof ArgumentsSchema
|
|
|
93
95
|
if (recipe.mode === "generate" && !options.count) throw commandError(`recipe "${name}" needs --count <N>`)
|
|
94
96
|
|
|
95
97
|
const seed = options.seed != null ? Number(options.seed) : Date.now()
|
|
98
|
+
|
|
96
99
|
const opts: ShardRecipeOpts = {
|
|
97
100
|
output: options.output,
|
|
98
101
|
seed,
|
|
@@ -119,13 +122,19 @@ const CorpusShard: CommandComponent<typeof OptionsSchema, typeof ArgumentsSchema
|
|
|
119
122
|
}
|
|
120
123
|
|
|
121
124
|
console.error(`▸ shard recipe "${name}" [${recipe.mode}] seed=${seed} → ${options.output}`)
|
|
125
|
+
|
|
122
126
|
const stream = createWriteStream(options.output, { encoding: "utf8" })
|
|
127
|
+
|
|
123
128
|
const write = (line: string): void => {
|
|
124
129
|
stream.write(line)
|
|
125
130
|
}
|
|
131
|
+
|
|
126
132
|
const stats = await recipe.run(opts, write)
|
|
127
133
|
stream.end()
|
|
128
|
-
|
|
134
|
+
|
|
135
|
+
await new Promise<void>((res) => {
|
|
136
|
+
stream.on("finish", () => res())
|
|
137
|
+
})
|
|
129
138
|
|
|
130
139
|
return [
|
|
131
140
|
`recipe: ${name}`,
|
|
@@ -23,6 +23,7 @@ export { OptionsSchema as options }
|
|
|
23
23
|
const Cmd: CommandComponent<typeof OptionsSchema> = ({ options }) => {
|
|
24
24
|
const state = useCommandTask(async () => {
|
|
25
25
|
const { buildCorpusStats } = await import("@mailwoman/corpus/tools")
|
|
26
|
+
|
|
26
27
|
await buildCorpusStats({
|
|
27
28
|
shardsArg: options.shards,
|
|
28
29
|
outputPath: options.output,
|