# === v1.9.8-bare-street-bsplice (#901 run 1 — the fr-bare-street source on the shipped spliced base) ===
# night-31 (2026-07-02, $30 cap). Restores the v4.16.0-demo-only fr-bare-street capability that the v5.1.0
# repoint traded away — now trained on the spliced vocab so it ships in the main line. One variable vs the
# shipped v5.1.0 model: the synth-fr-bare-street source (the corpus + weights below are v1.9.4 verbatim,
# which is v1.9.3a3 + that one source).
#
# case-AUG deliberately excluded (schedule adjustment vs the night plan): v1.9.6-surface-aug-full was
# shelved 2026-06-30 (#261) — the metamorphic layer introduced 2 casing/whitespace regressions, and the
# deterministic fix (#834 normalize + #895 normalizeCase default-on, landed 2026-07-02) covers the gap.
# Revisit only with a recipe that clears the metamorphic check. not tonight rather than as a second variable.
#
# init: init_from /data/models/bsplice-expanded (the v5.1.0 surgery export: v1.9.3a3 weights + 10,582
# mean-init rows). resume is impossible here. The export holds no optimizer state and the old moments
# wouldn't match the expanded embedding shape. the skill's resume-rule presumes a resumable ckpt. The
# v1.9.7 fine-tune block is the precedented idiom (fresh optimizer, lr 5e-5, warmup 200, constant).
#
# sequence: probe = 2k steps (this file as-is). Probe check (pre-registered, check-v193/results.md):
# fr-parse-recall.ts bare-FR street-intact rate rises from the shipped-pair baseline and US quick
# samples hold. Early-kill @1k on non-decreasing loss. On a pass, resume this run's step-002000 ckpt with
# max_steps bumped to 12000 (the +10k full-run precedent from v1.9.4). Full check = the night plan table.
# Launch: node packages/mailwoman/tools/training/launch/launch.run.ts start --config v1.9.8-bare-street-bsplice.yaml
#
# --- v1.9.4 header (the source's rationale) kept below for the record ---
# === v1.9.4-fr-bare-street (#251/#148 — teach the FR street→locality boundary without a postcode anchor) ===
# full RUN (probe green: 2k-step step-082000 gave bare-FR street-intact 89→92%, demo "Rue du Chevaleret,
# Paris" fixed, US 4/4 tag-identical → imbalance confirmed rather than modeling deficit). Continue from the probe's
# step-082000 (the default resume) to step-092000 (+10k); eval every 2k → check each checkpoint (US per-tag floors)
# and ship the FR-up/US-held sweet spot. Same single variable (the fr-bare-street source) — clean attribution.
# v1.9.3a3 (shipped v4.16.x) is verbatim below except: corpus_dir → the v0.9.4 overlay, and one new
# source_weight (synth-fr-bare-street). Everything else — model, anchor knobs, class_weights, country_weights,
# the other source_weights, LR/schedule — is identical to v193a3, so the single variable is the new source
# (clean attribution).
#
# root mechanism (DeepSeek Pro 019f1097 + libpostal's own documented practice, both independent): every
# full-coverage FR source (BAN, OSM) is postcode-complete, so the decoder learned the FR street→locality
# boundary as "the token after the 5-digit postcode," never as "comma + city." Strip the postcode and proper-
# noun street tokens leak into the following locality ("Rue René Cassin, Paris" → street="Rue Ren",
# locality="Cassin"). Measured: 90% FR streets intact, a ~10% bare-no-postcode tail that owns the demo
# address. Not data absence (BAN is in the corpus) — postcode-anchoring distribution imbalance.
#
# the change (one variable): the synth-fr-bare-street recipe output — 10.8k real BAN (street, number, city) tuples
# rendered as the missing distribution: bare comma form "<n> Rue <proper-noun name>, <City>", no postcode.
# BAN-sourced (Licence Ouverte / permissive) on purpose — the model must stay clean of the ODbL OSM data
# (that's quarantined to the opt-in rooftop sources). Weight 6.0 = the targeted-fix precedent
# (synth-german / synth-fr-admin-split / gnaf all 6.0).
#
# check (the probe — falsifies coverage-imbalance vs modeling-deficit, per DeepSeek): re-run
# scripts/diagnostic/fr-parse-recall.ts (bare FR street-intact rate, target the 90%→tail) and US/intl
# no-regression (the per-tag floors). moves → imbalance confirmed → scale to the full-length resumed run within the $20 cap.
# flat → modeling deficit (comma-boundary feature / decoder), a different fix. conventions-loss-mask is off
# in this lineage already (v193a3), and FR street_prefix is taught by synth-fr-admin-split today, so the
# v1.6.0 ~7M-loss mask blow-up doesn't apply here. Not promoted without operator GO + the check.
# Launch: node packages/mailwoman/tools/training/launch/launch.run.ts start --config v1.9.4-fr-bare-street.yaml
data:
  # v0.9.4 overlay = v0.9.3a3's 694 parquet files verbatim (re-rooted to /data) + the 1 fr-bare-street parquet file.
  corpus_dir: /data/corpus/versioned/v0.9.4-fr-bare-street/corpus-v0.9.4-fr-bare-street
  tokenizer_dir: /data/models/tokenizer/v0.6.0-bsplice
  max_length: 128
  country_weights: # Verbatim from v1.9.3a3 (22 countries) — no new locales (surgical).
    US: 1.0
    FR: 1.0
    DE: 1.0
    ES: 1.0
    IT: 1.0
    NL: 1.0
    PT: 1.0
    BE: 1.0
    PL: 1.0
    AT: 1.0
    CH: 1.0
    CZ: 1.0
    DK: 1.0
    "NO": 1.0
    SE: 1.0
    FI: 1.0
    IE: 1.0
    GB: 1.0
    SK: 1.0
    SI: 1.0
    HR: 1.0
    HU: 1.0
    AU: 1.0
  source_weights: # Verbatim from v1.9.3a3 + the one new fr-bare-street source.
    wof-admin: 2.0
    wof-postalcode: 2.0
    ban: 3.0
    tiger: 4.0
    usgov-nppes: 2.0
    usgov-hrsa-fqhc: 2.0
    usgov-imls-pls: 2.0
    usgov-nad: 1.0
    state-ia-contractors: 2.0
    state-tx-notaries: 1.5
    state-ny-notaries: 2.0
    deepseek-kryptonite: 3.0
    synth-intersection: 1.0
    synth-german: 6.0
    synth-fr-order: 3.0
    synth-fr-admin-split: 6.0
    synth-unit: 1.5
    synth-po-box-cedex: 1.5
    synth-affix: 2.0
    synth-country: 2.0
    overture: 3.0
    gnaf: 6.0
    synth-anchor-absorption: 6.0
    # #251 new: the bare-no-postcode FR street source. 6.0 = targeted-fix precedent.
    synth-fr-bare-street: 6.0
  train_rows_per_epoch: 1000000
  val_rows: 4096
  coarse_filter: true
  augment_directional_prob: 0.3
  augment_region_prob: 0.3
  augment_glue_prob: 0.25
  anchor_lookup_path: /data/anchor/pilot-anchor-lookup.json
  gazetteer_lexicon_path: /data/gazetteer/anchor-lexicon-v1.json
  gazetteer_choreography: true
  affix_relabel_lexicon_path: /data/gazetteer/affix-relabel-lexicon-v1.json
  anchor_paint_mode: shaped
  anchor_value_mode: posterior_latlon

model: # Verbatim from v1.9.3a3.
  hidden_size: 384
  num_hidden_layers: 6
  num_attention_heads: 6
  intermediate_size: 1536
  max_position_embeddings: 128
  type_vocab_size: 1
  hidden_dropout_prob: 0.1
  attention_probs_dropout_prob: 0.1
  use_crf: true
  crf_loss_weight: 0.0
  crf_normalization: per_sequence
  label_smoothing: 0.1
  use_locale_conditioning: true
  locale_loss_weight: 0.3
  use_postcode_anchor: true
  use_gazetteer_anchor: true
  gazetteer_feature_dim: 5
  class_weights:
    O: 0.5
    B-country: 3.5
    I-country: 3.5
    B-region: 1.5
    I-region: 1.5
    B-locality: 2.0
    I-locality: 2.0
    B-dependent_locality: 0.3
    I-dependent_locality: 0.3
    B-postcode: 1.5
    I-postcode: 1.5
    B-subregion: 0.3
    I-subregion: 0.3
    B-cedex: 1.0
    I-cedex: 1.0
    B-venue: 1.5
    I-venue: 1.5
    B-street: 2.0
    I-street: 2.0
    B-house_number: 1.5
    I-house_number: 1.5
    B-street_prefix: 1.5
    I-street_prefix: 1.5
    B-street_suffix: 1.5
    I-street_suffix: 1.5
    B-unit: 1.5
    I-unit: 1.5
    B-po_box: 1.5
    I-po_box: 1.5
    B-intersection_a: 1.0
    I-intersection_a: 1.0
    B-intersection_b: 1.0
    I-intersection_b: 1.0
  use_phrase_priors: true
  phrase_feature_dim: 10

train: # v1.9.7 init_from idiom (fresh optimizer over the surgery export); data blocks v1.9.4-verbatim.
  init_from: /data/models/bsplice-expanded
  output_dir: /data/output-v198-bare-street-bsplice-s42/checkpoints
  seed: 42
  batch_size: 128
  eval_batch_size: 128
  grad_accum_steps: 1
  learning_rate: 5.0e-5
  weight_decay: 0.01
  warmup_steps: 200
  grad_clip_norm: 1.0
  # full RUN: the default resume picks the probe's step-082000 (latest in output_dir); max_steps 92000 → +10k.
  # Constant LR 1.5e-4. anchor-dropout curriculum at full strength. Eval every 2k → check 84/86/88/90/92k and
  # ship the best (FR street-intact up, US floors held).
  max_steps: 12000
  eval_every_steps: 2000
  save_every_steps: 2000
  log_every_steps: 50
  precision: bf16
  num_workers: 0
  csv_log_path: "{output_dir}/../train_log.csv"
  lr_schedule: constant
  gazetteer_curriculum: false
  trackio_project: mailwoman
  trackio_run_name: v1.9.8-bare-street-bsplice-s42

eval:
  golden_dir: /data/eval/golden/v0.1.2
  val_jsonl: ""
