Skip to content

Add release-time provenance verification against upstream - #21

Merged
OVVO-Financial merged 1 commit into
mainfrom
claude/intelligent-johnson-6ctwxv
Jun 14, 2026
Merged

Add release-time provenance verification against upstream#21
OVVO-Financial merged 1 commit into
mainfrom
claude/intelligent-johnson-6ctwxv

Conversation

@OVVO-Financial

Copy link
Copy Markdown
Owner

Why

check_release_provenance.py only confirms the manifest is filled in (no unknown, tag matches version) — it trusts the recorded SHAs. This adds a self-checking layer so a hand-vendored tree with a stale r_commit/core_commit can't slip into a release (the exact situation that left the manifest as unknown until this session's backfill).

What

scripts/verify_release_provenance.py clones the upstreams at the recorded commits and proves the vendored bytes came from them:

  • core (hard): every top-level object under extern/NNS-core must exist in core_repo@core_commit. NNS-core is vendored by a plain copy, so its git objects appear verbatim upstream — layout/method-agnostic.
  • R src tree (hard, offline): recorded r_src_tree_hash must equal the vendored tools/NNS/src tree hash.
  • R tarball (hard when present): if r_repo commits the vendored tarball at r_commit, its blob must match the vendored tarball blob. (The built R package normalizes R/ sources — only 3/37 source blobs survive byte-identical — so the committed tarball is the reliable cross-repo anchor; absence is a skipped note, not a failure.)

Wired into the release workflow's provenance-check job for real releases only (push tag or publish=pypi); dry runs may carry placeholder provenance.

Validation (run locally)

  • ✅ Passes against the real manifest: extern/NNS-coreNNS-core@cfc25a34, tools/NNSNNS@905b8bbd.
  • ✅ Negative test: pointing core_commit at a commit with different core content fails with precise per-object messages.
  • ✅ Offline unit test (test_verify_provenance_offline.py) asserts the committed r_src_tree_hash matches the vendored tree — a standing guard against future drift.
  • ✅ ruff + mypy clean; release.yml parses.

https://claude.ai/code/session_012bjk4Y5eT1Sva8tNJjqUSw


Generated by Claude Code

check_release_provenance.py only confirms the manifest is filled in. Add
verify_release_provenance.py, which clones the upstream repos at the
recorded commits and proves the vendored bytes came from them, so a
hand-vendored tree with a stale r_commit/core_commit cannot ship:

- core (hard): every top-level object under extern/NNS-core must exist in
  core_repo@core_commit (NNS-core is vendored by a plain copy, so its git
  objects appear verbatim upstream).
- R src tree (hard, offline): recorded r_src_tree_hash must equal the
  vendored tools/NNS/src tree hash.
- R tarball (hard when present): if r_repo commits the vendored tarball at
  r_commit, its blob must match the vendored tarball blob. The built R
  package normalizes R/ sources, so the committed tarball is the reliable
  cross-repo anchor; absence is reported as a skipped note.

Wire it into the release workflow's provenance-check job for real releases
only (push tag or publish=pypi); dry runs may carry placeholder provenance.
Allow-list the script for the subprocess lint ban (it shells out to git),
and add an offline unit test asserting the committed manifest's
r_src_tree_hash matches the vendored tree.
@OVVO-Financial
OVVO-Financial merged commit 8890a3d into main Jun 14, 2026
4 checks passed
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.

2 participants