Skip to content

Pin DPO preference file in the bundle manifest (attested, secret-scanned) - #56

Merged
ai-hpc merged 1 commit into
mainfrom
feat/attest-preference-pairs
Jul 26, 2026
Merged

Pin DPO preference file in the bundle manifest (attested, secret-scanned)#56
ai-hpc merged 1 commit into
mainfrom
feat/attest-preference-pairs

Conversation

@ai-hpc

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

Copy link
Copy Markdown
Member

Follow-up to #52 (correctness preference-pair exporter). Makes the preference file part of the verifiable bundle instead of an out-of-band jsonl, so the SparkDistill DPO track can trust it the same way it trusts the SFT dataset.

What

sparkproof-triton-generate --export-preferences:

  1. builds correctness pairs (verified vs validated-failing) from the run's adjudication,
  2. secret-scans each pair with the release-gate patterns — a failing kernel that leaked an API key / host path is dropped, never published,
  3. writes preferences.jsonl into the bundle, and
  4. sha256-pins it in the manifest (preferences_sha256), carried through the Blackwell re-seal.

verify then re-checks it tamper-evidently, exactly like prompts.jsonl, and it ships in proof/.

Changes

  • manifest.py: optional preferences_sha256 on both DatasetManifest (v1) and BlackwellDatasetManifest (v2) + build_manifest/build_manifest_v2 params.
  • pipeline/blackwell.py: carry the pin through the v1→v2 re-seal (one line, mirrors prompts_sha256/sampling).
  • verify.py: when a bundle pins preferences_sha256, preferences.jsonl must exist and match. Optional — existing bundles are unaffected; the check only runs when the pin is present.
  • publish/hf_dataset.py: preferences.jsonl in PROOF_ARTIFACTS (uploaded only when present).
  • dpo_export.write_preferences_into_bundle helper (secret-scan + sha via the same sha256_file verify uses).

Verification

  • uv run pytest385 passed, 9 skipped · ruff clean · pyright 0 errors on changed modules
  • Tests: verify guard (match / tamper / pinned-but-missing), the write helper + secret-scan drop, PROOF_ARTIFACTS membership, and the pinned-list test updated.

Deliberate follow-up (not in this PR)

Fold preferences_sha256 into the GPU/TDX attestation nonce (hashing.dataset_attestation_nonce + verify_gpu_attestation) so the rejected side is attestation-bound, not just sha-referenced. The chosen side is already a Merkle-committed verified winner; this MVP keeps the change to the offline-verifiable sha-pin, as flagged in the #52 review.

…scanned)

Follow-up to the correctness preference-pair exporter (#52): make the preference
file part of the verifiable bundle instead of an out-of-band jsonl.

- sparkproof-triton-generate --export-preferences: builds correctness pairs from
  the run's adjudication, secret-scans each pair (release-gate patterns) so a
  leaked key/host path never ships, writes preferences.jsonl into the bundle, and
  sha256-pins it in the manifest (preferences_sha256).
- manifest.py: optional preferences_sha256 on both DatasetManifest (v1) and
  BlackwellDatasetManifest (v2) + build_manifest/build_manifest_v2 params; the pin
  is carried through the Blackwell re-seal (pipeline/blackwell.py).
- verify.py: tamper-evident check — when a bundle pins preferences_sha256, the
  file must exist and match (mirrors the prompts.jsonl guard). Optional, so
  existing bundles are unaffected.
- publish/hf_dataset.py: ship preferences.jsonl in proof/ when present.
- dpo_export.write_preferences_into_bundle helper + tests.

Deliberate follow-up: fold preferences_sha256 into the GPU/TDX attestation nonce
so the rejected side is attestation-bound, not just sha-referenced.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ai-hpc
ai-hpc merged commit 105e101 into main Jul 26, 2026
1 check passed
@ai-hpc ai-hpc mentioned this pull request Jul 26, 2026
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