Skip to content

ci: materialize Windows release provenance from run head - #125

Merged
Pedro Henrique Penna (ppenna) merged 2 commits into
devfrom
fix-windows-release-provenance-blobs
Sep 19, 2026
Merged

Pedro Henrique Penna (ppenna) merged 2 commits into
devfrom
fix-windows-release-provenance-blobs

Conversation

@ppenna

Copy link
Copy Markdown
Contributor

Summary

  • materialize kernel/config-microvm and every kernel patch from raw HEAD blobs before Windows release packaging
  • remove the package step's dependency on mutable self-hosted runner index state
  • add a regression that stages CRLF variants and proves run-head materialization restores canonical bytes

Root cause

CI run 35416685879, attempt 1 at 1f13439406a10fff2cd7ad0c79f7b61720aeeb52, failed in Platform / Windows / WHP / Virtual machine -> Package release:

error: kernel build provenance does not match the current source, config, and vmlinux

The remediation merged in #123 executed successfully immediately before packaging, but it still sourced the input list and bytes from the persistent checkout's mutable Git index. A fresh checkout and the complete reduced WHP platform sequence preserved all artifact hashes, while CRLF-tainted kernel inputs reproduced the exact package failure locally. Packaging therefore still lacked an immutable run-head boundary.

The new helper resolves the config and patch inventory from the workflow run's HEAD, writes the raw committed blobs, and rejects a run head missing either class of input.

Validation

  • reproduced the exact package failure with run 35416685879 guest and OpenVMM artifacts
  • ran the reduced Windows WHP platform sequence and confirmed every provenance input hash remained unchanged
  • reran the original Windows package and deterministic archive commands successfully after immutable materialization
  • python scripts\nvx.py verify
  • complete Windows validate-nvx: 236 NVX tests (1 skipped), 4 host-profile tests, and CLI smoke checks
  • Ruff lint and formatting
  • Pyright for Linux and Windows

The Windows package job compared Linux-built provenance against a mutable self-hosted checkout. The prior checkout-index remediation could complete without proving every kernel input came from the workflow run's commit, and dev failed again.

Resolve the config and patch inventory from HEAD and write their raw run-head blobs before packaging. Cover the failure mode by staging CRLF variants in a temporary index and verifying immutable materialization restores the canonical bytes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 19, 2026 03:18

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.

Copilot review overview

🟡 Changes recommended

Stale non-HEAD patch files can still alter provenance and break Windows packaging.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Materializes Windows kernel provenance inputs directly from immutable HEAD blobs before release packaging.

Changes:

  • Adds a provenance-input materialization CLI command.
  • Replaces index-based Windows rematerialization.
  • Adds CRLF/index-state regression coverage.
File Description
.github/​actions/​package-release/​action.yml Invokes immutable materialization before Windows packaging.
scripts/​nvx.py Exposes the new CLI command.
scripts/​nvx_tools/​build.py Reads config and patch blobs from HEAD.
scripts/​test_nvx_tools.py Tests canonical restoration despite a mutated index.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/nvx_tools/build.py
Windows release packaging derives kernel provenance from the worktree after materializing run-head blobs. Remove patch files absent from HEAD so a persistent staged or untracked patch cannot alter the expected fingerprint.

Extend the regression with a stale staged patch and verify materialization deletes it while restoring the committed inputs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 19, 2026 03:27

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.

Copilot review overview

🟢 Approval recommended

The implementation removes mutable-index dependence and directly covers the reported regression.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@ppenna
Pedro Henrique Penna (ppenna) merged commit 0f167ba into dev Sep 19, 2026
37 of 38 checks passed
@ppenna
Pedro Henrique Penna (ppenna) deleted the fix-windows-release-provenance-blobs branch September 19, 2026 04:16
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