Repository navigation
build: reject Ubuntu initramfs source edits made during packing - #584
Open
Jay (jay23606) wants to merge 1 commit into
Open
Jay (jay23606) wants to merge 1 commit into
Jay (jay23606) wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused guard addresses the provenance mismatch with regression coverage for both outcomes and no identified blocking issues.
0 open findings
What changed in this PR
Fixes #506 by preventing native Ubuntu initramfs builds from recording provenance that does not match their source inputs.
Changes:
- Captures the customization digest before root preparation and checks it again after packing.
- Removes the artifact and manifest and fails if inputs changed.
- Adds regression coverage for changed and unchanged sources.
| File | Description |
|---|---|
| scripts/test_nvx_tools.py | Tests source-mutation rejection, cleanup, and unchanged-source success. |
| scripts/nvx_tools/build.py | Adds the Ubuntu input digest snapshot and post-pack validation. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Jay (jay23606)
force-pushed
the
fix/ubuntu-initramfs-input-snapshot
branch
from
October 16, 2026 20:44
14dd272 to
a0907fc
Compare
The Ubuntu manifest recorded the customization digest computed after the archive was packed, so an edit to a customization source during the build produced an artifact whose helpers came from the old source while the manifest advertised the new digest. The release guest-input gate accepted it. Snapshot the digest before the root is prepared and compare it again after packing. On a mismatch, remove the artifact and its manifest and fail, as the Alpine and kernel builds already do. Fixes microsoft#506 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
Jay (jay23606)
force-pushed
the
fix/ubuntu-initramfs-input-snapshot
branch
from
October 17, 2026 00:45
a0907fc to
1eaf367
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #506.
Summary
initramfs source inputs changed during the build, matching the Alpine and kernel paths.Test
test_ubuntu_initramfs_rejects_source_mutation_during_pack: the mutation case fails before this change (noScriptError) and passes after; the unchanged-source control passes before and after.test_nvx_tools.py: 485 pass, 54 skipped, 0 failures. ruff check and ruff format are clean.🤖 Generated with Claude Code