Skip to content

fix: recover root release provenance safely#1770

Merged
mldangelo-oai merged 30 commits into
mainfrom
mdangelo/codex/fix-root-provenance-20260720
Jul 22, 2026
Merged

fix: recover root release provenance safely#1770
mldangelo-oai merged 30 commits into
mainfrom
mdangelo/codex/fix-root-provenance-20260720

Conversation

@mldangelo-oai

Copy link
Copy Markdown
Contributor

Summary

Adds a provenance-only recovery path for the already-published root releases without attempting to republish immutable PyPI artifacts. The recovery is bound to the original successful publish/verify run and the intended release tag, rejects unrelated or moved source/tag histories, permits only the two known workflow/test repair files between tag and source, validates exact artifact hashes and tagged metadata, and fails closed on unsafe or ambiguous archive members before generating the recovery integrity attestation and SBOM.

The intended recoveries are:

  • v0.2.50 from run 29787069929 (fa350d96d2e00e0d54c47f282b7f8e0f9660e077)
  • v0.2.51 from run 29787493719 (ba9cba9568f52ed8464b7a95c46d366e7ba25c6c)

Both original runs completed build, publish-pypi, and verify-pypi successfully; their provenance gates were skipped, which this PR truthfully recovers.

Validation

  • actionlint -no-color .github/workflows/release-please.yml
  • prettier --check .github/workflows/release-please.yml docs/agents/release-process.md
  • Ruff check/format, mypy, and git diff --check
  • 107 passed in tests/test_release_workflow.py, including executable negative cases for source/tag divergence, unexpected repair deltas, invalid metadata, archive aliases/collisions, links, devices, and bounded-size failures
  • Three independent native high-risk exact-head reviews plus an independent verifier: clean, no actionable findings

No scanner detections or package constraints are weakened.

Copilot AI review requested due to automatic review settings July 21, 2026 19:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a provenance-only recovery path to the release-please GitHub Actions workflow to regenerate/attach provenance artifacts for already-published modelaudit releases without attempting to rebuild or republish immutable PyPI artifacts. The recovery flow is designed to bind to a specific previously successful publish/verify run and the intended tag, validate artifact integrity against PyPI digests, and fail closed on unsafe archive contents before generating a recovery attestation and SBOM.

Changes:

  • Adds a root_provenance_run_id workflow_dispatch input and corresponding “provenance recovery” execution mode in release-please.yml.
  • Introduces a dedicated root-provenance-recovery job that verifies the source run/tag relationship, downloads the original build artifacts, validates them against PyPI, and emits a recovery attestation + SBOM.
  • Expands the release workflow test suite and updates maintainer documentation to cover provenance recovery.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/test_release_workflow.py Adds extensive workflow-structure assertions and executable tests for provenance-only recovery guardrails and failure-closed artifact verification.
docs/agents/release-process.md Documents when/how to run provenance-only recovery and the safety constraints it enforces.
.github/workflows/release-please.yml Adds the provenance recovery input, guards release creation during recovery, tightens provenance job gating, and implements the new root provenance recovery job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release-please.yml Outdated
@codecov-commenter

codecov-commenter commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.27%. Comparing base (e9910fa) to head (0293c95).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1770      +/-   ##
==========================================
+ Coverage   76.25%   76.27%   +0.01%     
==========================================
  Files         217      217              
  Lines      115193   115278      +85     
  Branches    27107    27124      +17     
==========================================
+ Hits        87845    87928      +83     
- Misses      19974    19975       +1     
- Partials     7374     7375       +1     

see 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI review requested due to automatic review settings July 21, 2026 19:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment thread .github/workflows/release-please.yml Outdated
Comment thread .github/workflows/release-please.yml
Comment thread tests/test_release_workflow.py
Comment thread tests/test_release_workflow.py Outdated
Copilot AI review requested due to automatic review settings July 21, 2026 19:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/release-please.yml
Copilot AI review requested due to automatic review settings July 21, 2026 20:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 22, 2026 03:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 22, 2026 04:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/release-please.yml Outdated
Copilot AI review requested due to automatic review settings July 22, 2026 04:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Workflow run and artifacts

Performance Benchmarks

Compared 13 shared benchmarks with a regression threshold of 15%.
Status: 0 regressions, 0 improved, 13 stable, 0 new, 0 missing.
Aggregate shared-benchmark median: 4.241s -> 4.438s (+4.6%).

Workload Benchmark Target Size Files Baseline Current Change Status
rejected-basic-auth-candidates tests/benchmarks/test_scan_benchmarks.py::test_rejected_basic_auth_candidates_scan_linearly - 371.1 KiB 1 2.434s 2.615s +7.4% stable
warm-cache-rescan tests/benchmarks/test_scan_benchmarks.py::test_scan_warm_cached_repository_rescan release-candidate 547.3 KiB 32 129.64ms 138.37ms +6.7% stable
nested-payload-review tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_nested_payload_review[nested_base64] nested_base64 98 B 1 249.9us 255.4us +2.2% stable
direct-malicious-upload tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_direct_malicious_upload malicious_reduce 52 B 1 185.9us 189.5us +1.9% stable
padded-multi-stream-upload tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_padded_multi_stream_upload multi_stream_padded 4.1 KiB 1 290.0us 294.5us +1.5% stable
mixed-model-repository tests/benchmarks/test_scan_benchmarks.py::test_scan_release_candidate_repository release-candidate 547.3 KiB 32 616.16ms 621.12ms +0.8% stable
single-checkpoint-preflight tests/benchmarks/test_scan_benchmarks.py::test_scan_single_checkpoint_before_load single_checkpoint.pkl 183.0 KiB 1 105.88ms 106.42ms +0.5% stable
nested-payload-review tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_nested_payload_review[nested_hex] nested_hex 130 B 1 261.9us 263.0us +0.4% stable
nested-payload-review tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_nested_payload_review[nested_raw] nested_raw 78 B 1 233.5us 234.2us +0.3% stable
duplicate-heavy-registry tests/benchmarks/test_scan_benchmarks.py::test_scan_duplicate_registry_snapshot registry-snapshot 915.2 KiB 13 577.55ms 578.76ms +0.2% stable
clean-training-checkpoint tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_clean_training_checkpoint safe_large 278.2 KiB 1 113.84ms 114.00ms +0.1% stable
chunked-upload-stream tests/benchmarks/test_picklescan_benchmarks.py::test_picklescan_chunked_upload_stream chunked_stream 278.2 KiB 1 117.14ms 117.30ms +0.1% stable
suspicious-pickle-intake tests/benchmarks/test_scan_benchmarks.py::test_scan_suspicious_pickle_intake suspicious-intake 183.8 KiB 4 146.06ms 145.94ms -0.1% stable

@mldangelo-oai
mldangelo-oai enabled auto-merge (squash) July 22, 2026 05:24

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 99a7c3580e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/test_release_workflow.py Outdated
]

assert len(picklescan_requirements) == 1
assert picklescan_requirements[0].startswith(f"modelaudit-picklescan>={picklescan_project['version']},")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep picklescan-only releases independent

When a picklescan-only patch bumps the sibling from, for example, 0.1.9 to 0.1.10, the root requirement >=0.1.9,<0.2.0 still accepts it, but this exact-floor assertion fails CI. Maintainers would have to modify the root dependency—and consequently trigger an unnecessary root release—even though the release process says the components bump independently; validate that the sibling satisfies the declared range rather than requiring every sibling version to become the new floor.

AGENTS.md reference: AGENTS.md:L14-L21

Useful? React with 👍 / 👎.

@mldangelo-oai
mldangelo-oai merged commit 1e0dcb6 into main Jul 22, 2026
43 checks passed
@mldangelo-oai
mldangelo-oai deleted the mdangelo/codex/fix-root-provenance-20260720 branch July 22, 2026 16:38
@github-actions github-actions Bot mentioned this pull request Jul 22, 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.

3 participants