# v2.5.0-fragment-assay — probe 1 of the parity campaign (night-1, 2026-07-13): the fragment-source
# assay rather than a ship candidate. Refutes-or-confirms the hypothesis that new data, with no
# architecture change, closes the fragment gap on the current architecture. the pre-registered read-out separator (campaign runbook) is:
#   token-F1 up + span-exact-match lag + trailing-number→postcode persisting  ⇒  #727 span-head
#   ceiling confirmed → redirect budget to the structured-span-head arc. do not ship this.
#
# recipe = v2.4.1-fr-nsplice-ft verbatim, with exactly these deltas (one change: the source):
#   1. corpus_dir → v0.10.2-fragment-assay overlay (v0.10.1's 699 parquet files verbatim via manifest
#      cross-dir refs + part-fragment.parquet: 123,272 rows, 16 OA locales + tiger-block US streets,
#      balanced polarity — bare-street/street+trailing-number rows and bare-locality twins. the
#      #511 spread-scan measured recipe-output street surfaces ~46% street-family / ~54% admin in the base,
#      so street-only rows would have taught "context-free name = street").
#   2. source_weights += synth-fragment: 6.0 (the synth-nl-postcode moderate precedent rather than the 12.0
#      targeted-fix weight — an assay mustn't outvote the base).
#   3. init_from → the shipped v241 step-012000 (same vocab, so the same-vocab fine-tune LR 1e-5 —
#      v230 precedent — not the 5e-5 splice-adaptation LR. there are no new embedding rows to move).
#   4. short run, tight cadence (the v196 scar: long constant-LR fine-tunes overfit late. 40k was
#      flat, 80k regressed): 6000 steps, eval/save every 1000 → 6 conditional checkpoints, early read at
#      2000 per the diagnostic-before-fix discipline.
#   5. output_dir/run name → v250-fragment-assay (fresh dir. init_from reads v241, never overwrites).
#
# checks when checkpoints land (grade with `mailwoman eval parity --weights-cache` — never --model
# explicit paths, the #718 zero-fill trap): parity floors house_number ≥0.97 / postcode ≥0.97 /
# street ≥0.90. fragment-dev (13,696 held-out rows, local scratchpad + volume copy) token-F1 and
# span-exact-match. US/FR non-regression on the parity per-country table. NaN protocol standard.
data:
  corpus_dir: /data/corpus/versioned/v0.10.2-fragment-assay/corpus-v0.10.2-fragment-assay
  tokenizer_dir: /data/models/tokenizer/v0.8.0-fr-nsplice
  max_length: 128
  country_weights: # Verbatim from v2.4.1.
    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 v2.4.1, plus the one new assay 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
    synth-fr-bare-street: 12.0
    synth-si-bare-village: 12.0
    synth-no-street-led: 12.0
    synth-cz-pcfirst-preposition: 12.0
    synth-nl-postcode: 6.0
    # probe 1: the fragment/autocomplete source (assay weight — moderate precedent).
    synth-fragment: 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 v2.4.1.
  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: # Same-vocab init_from fine-tune off the shipped v241 (fresh optimizer; --resume auto on a
  # fresh output_dir honors init_from, weights only).
  output_dir: /data/output-v250-fragment-assay-s42/checkpoints
  seed: 42
  init_from: /data/output-v241-fr-nsplice-ft-s42/checkpoints/step-012000
  batch_size: 128
  eval_batch_size: 128
  grad_accum_steps: 1
  learning_rate: 1.0e-5
  weight_decay: 0.01
  warmup_steps: 200
  grad_clip_norm: 1.0
  max_steps: 6000
  eval_every_steps: 1000
  save_every_steps: 1000
  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: v2.5.0-fragment-assay-s42

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