# === v1.3.0-boundary-consolidation (the v4.4.0 run) ==============================================
# The v1.1.0 ship recipe from scratch on corpus v0.4.15-boundary, carrying the three probe-passed
# changes (solo probes 2026-06-11, each single-variable vs v1.1.0):
#   1. glue augmentation 0.25 (PR #514) — probe: fused-row region 52->93 / postcode 57->97, affix flat.
#   2. intersection source @ 1.0 (PR #515) — probe: intersection-real 100/100, VT golden 94.9/96.1, zero false fires.
#   3. po_box/cedex recipe output v2 @ 1.5 (PR #516, rebuilt minus the '#' template — probe measured it
#      colliding with the shipped unit convention) — probe: cedex 94.6 passed. po_box 57.5 was the
#      punctuation-truncation class at +4k exposure. this run's 10x exposure answers it under the
#      check's po_box floor. Bonus banked: the cedex layouts fixed the FR digit-split in-weights (6->2).
# stated config decisions (no silent drift):
#   - synth-po-box (the old fixed-layout source) retired — key removed, its rows drop (source filter).
#     po_box mass now comes from one provenanced source. double-counting was the alternative.
#   - Train-time conventions pairing deferred: designed but unprobed — it doesn't ride a
#     consolidation on theory (the discipline that caught Run B's confound). Its own probe next.
# check: scripts/eval/checks/v4.4.0-boundary.json (pre-registered before any change existed) —
# incl. fr.region floored 16.2, perturb arena >= 71, po_box >= 70 real / cedex >= 70, intersection >= 50.
# (The spec's po_box/cedex floors read data/eval/external/po-box-cedex-val.jsonl. intersection reads
# intersection-real + the VT golden. Runner extension lands with the check.)
# Launch: node packages/mailwoman/tools/training/launch/launch.run.ts start --config v1.3.0-boundary-consolidation.yaml --fresh
data:
  corpus_dir: /data/corpus/versioned/v0.4.15-boundary
  tokenizer_dir: /data/models/tokenizer/v0.6.0-a0
  max_length: 128
  country_weights:
    US: 1.0
    FR: 1.0
    DE: 1.0
  source_weights:
    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
    # Change 2 (#487, probe-passed): real-tiger crossings.
    synth-intersection: 1.0
    synth-german: 6.0
    # Every proven change runs at its solo-validated weight.
    synth-unit: 1.5
    # Change 3 (probe: cedex passed, po_box answered by this run's exposure). Old synth-po-box retired (see header).
    synth-po-box-cedex: 1.5
    synth-affix: 2.0
    synth-country: 2.0
  train_rows_per_epoch: 1000000
  val_rows: 4096
  coarse_filter: true
  augment_directional_prob: 0.3
  augment_region_prob: 0.3
  # Change 1 (#513, probe-passed): region+postcode fusion.
  augment_glue_prob: 0.25
  anchor_lookup_path: /data/anchor/pilot-anchor-lookup.json
  gazetteer_lexicon_path: /data/gazetteer/anchor-lexicon-v1.json
  # The v0.9.12 US-postcode fix (#468): zero the gazetteer clue on tokens adjacent to a postcode-anchor
  # hit, at train time (paired with classifier.suppressGazetteerNearPostcode at inference). First trained here.
  gazetteer_choreography: true
  # the #511 change: end the base-vs-recipe affix label contradiction (probe-validated v1.0.6).
  affix_relabel_lexicon_path: /data/gazetteer/affix-relabel-lexicon-v1.json

model:
  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:
  output_dir: /data/output-v130-boundary-s42/checkpoints
  seed: 42
  batch_size: 128
  eval_batch_size: 128
  grad_accum_steps: 1
  learning_rate: 1.5e-4
  weight_decay: 0.01
  warmup_steps: 1000
  grad_clip_norm: 1.0
  max_steps: 40000
  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.3.0-boundary-consolidation-s42

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