Skip to content

Complete the DPO training track: gate orchestration + miner prep - #277

Open
ai-hpc wants to merge 1 commit into
mainfrom
feat/dpo-track-complete
Open

Complete the DPO training track: gate orchestration + miner prep#277
ai-hpc wants to merge 1 commit into
mainfrom
feat/dpo-track-complete

Conversation

@ai-hpc

@ai-hpc ai-hpc commented Jul 26, 2026

Copy link
Copy Markdown
Member

Completes the DPO submission path. With the reward-gate pin selection and the per-track frontier already merged, this makes the training gate accept a DPO PR end-to-end — while keeping SFT byte-identical.

What's now track-aware (eval/training_track_gate.py)

  • pr_training_track(head_ref, recipe_paths) — a PR whose changed recipe is rl: dpo competes on the DPO track.
  • validate_pr_body_canonical_pin(pr_body, track=...) — a DPO PR must cite the canonical preference dataset URL + pref_sha256 (SFT PRs unchanged); fails closed if no preference pin is configured.
  • _canonical_pref_sha256s_for_pr_window — preference merge-base grace window (generalized the SFT window; SFT/pref wrappers keep all existing callers).
  • verify_remote_proof_bundle / _scores / _download_and_verify_bundle thread acceptable_pref_shas into verify_submission, which already selects the preference pin (check_canonical_dataset_claim) and the <arch>::dpo frontier.
  • gate_training_pr detects the track and routes both pin checks; the report carries track + acceptable_pref_shas.

Miner prep

  • eval.prepare_mining_dpo (scripts/prepare_mining_dpo.sh) — downloads the canonical preference dataset and writes the local chosen/rejected jsonl, byte-verified against pref_sha256.
  • eval/canonical_dataset.py: canonical_pref_repo_id, pref_sha256_matches_canonical_export.

Tests

Track detection; DPO body-pin citation (accept / wrong-sha reject / no-pin fail-closed); preference export writes chosen/rejected & rejects incomplete pairs. SFT paths untouched (existing tests green).

Verification

ruff/format clean · pyright 0 errors · pytest 344 passed local / 335 + 9 skipped CI-emulated.

Activation — deliberately deferred (one maintainer step + one policy fix)

A DPO bundle still fails closed until:

  1. the canonical preference dataset is published and its pref_manifest.pref_sha256 pin is written into datasets/canonical.json (a maintainer publishing step — the pref-pin writer / update_canonical_pin --dpo and the actual dataset are the remaining piece), and
  2. the dpo.yaml example recipe is shipped — which needs should_enforce_training_gate to distinguish a new recipe file from a proof-bundle submission (otherwise adding the file auto-closes the PR, as with DPO training-track foundation (rl: dpo recipe + track-aware canonical gate) #268).

Everything above is safe to land now: SFT is byte-identical and DPO still fails closed without the pin.

Makes DPO submissions work end-to-end at the gate (the reward-gate pin selection
and per-track frontier were already merged). SFT stays byte-identical.

- eval/training_track_gate.py: track-aware throughout.
  - pr_training_track(): a PR with a `rl: dpo` recipe competes on the DPO track.
  - validate_pr_body_canonical_pin(track=): DPO PRs cite the canonical preference
    URL + pref_sha256; fails closed when no preference pin is configured.
  - _canonical_pref_sha256s_for_pr_window(): preference merge-base grace window
    (generalized the sft window; sft/pref wrappers preserve callers).
  - verify_remote_proof_bundle + _scores + _download_and_verify_bundle thread
    acceptable_pref_shas into verify_submission (which already selects the
    preference pin + the <arch>::dpo frontier).
  - gate_training_pr detects the track and routes; report carries track +
    acceptable_pref_shas.
- eval/prepare_mining_dpo.py + scripts/prepare_mining_dpo.sh: download the canonical
  preference dataset, write chosen/rejected jsonl, verify against pref_sha256.
- eval/canonical_dataset.py: canonical_pref_repo_id, pref_sha256_matches_canonical_export.
- Tests: track detection, DPO body-pin citation (accept/reject/fail-closed), prep export.

Deferred activation (documented): publish the canonical preference dataset + write the
pref_manifest pin; ship dpo.yaml once should_enforce distinguishes a new recipe file from
a submission.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant