Skip to content

fix: manifest attribution of until: mutate - #333

Open
lczyk wants to merge 1 commit into
canonical:mainfrom
lczyk:fix/until-mutate-attribution
Open

lczyk wants to merge 1 commit into
canonical:mainfrom
lczyk:fix/until-mutate-attribution

Conversation

@lczyk

@lczyk lczyk commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor
  • Have you signed the CLA?

did some formal verification (fizzbee, my specs are here and here) of the cut path and found 7 minor bugs:

# slices/test-package.yaml
package: test-package
slices:
  myslice1:
    contents:
      /file: {text: foo, until: mutate}
  myslice2:
    contents:
      /file: {text: foo}
$ chisel cut --release ./ --arch amd64 --root $rootfs test-package_myslice1 test-package_myslice2 base-files_chisel
Extracting files from package "base-files"...
Extracting files from package "test-package"...
$ zstdcat $rootfs/var/lib/chisel/manifest.wall | grep '"kind":"path","path":"/file"'
{"kind":"path","path":"/file","mode":"0644","slices":["test-package_myslice1","test-package_myslice2"],"sha256":"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae","size":3}

myslice1 asked for /file to be gone after mutate, yet the manifest lists it as an owner. for extracted content (copy) in the same situation the until: mutate slice is not listed; the two paths through slicer.Run disagree.

repro using chisel-proxy:

$ alias chisel-proxy='go run github.com/lczyk/chisel-proxy/cmd/chisel-proxy@v0.3.0'
$ mkdir -p test-package/usr/share/doc/test-package
$ echo readme > test-package/usr/share/doc/test-package/README
$ chisel-proxy cut --arch amd64 ./test-package ./test-package.yaml \
    -- --root ./rootfs test-package_myslice1 test-package_myslice2 base-files_chisel
Extracting files from package "base-files"...
Extracting files from package "test-package"...
$ zstdcat ./rootfs/var/lib/chisel/manifest.wall | grep '"kind":"path","path":"/file"'
{"kind":"path","path":"/file","mode":"0644","slices":["test-package_myslice1","test-package_myslice2"],"sha256":"2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae","size":3}

with the fix, slices is ["test-package_myslice2"].

fix

generated content now does what extracted content does: a slice with until: mutate on a path is not an owner of that path. the existing test pinning the old behaviour is flipped, and a second case pins the extracted side.

no slice on any ubuntu-* branch has a generated path listed like this (the mixed-until pairs that exist, ca-certificates mozilla glob and libpam-runtime pam defaults, are all extracted), so no published manifest changes.

When several slices list the same path and only some of them say
"until: mutate", the path stays in the rootfs. Extracted content is
then attributed in the manifest to the slices that did not say it,
while generated content was attributed to every lister, including the
ones that asked for the path to be removed.

Generated content now follows the same rule as extracted content: a
slice that says "until: mutate" is never an owner of the path in the
manifest. No release branch has a generated path listed that way, so
no published manifest changes.

Copilot AI 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.

🟢 Approval recommended

No unresolved blocking issues were identified.

0 open findings

What changed in this PR

Fixes manifest ownership for generated paths using until: mutate, aligning them with extracted-content behavior.

Changes:

  • Excludes mutating slices from generated-path ownership.
  • Updates and expands attribution tests.
File Description
internal/​slicer/​slicer.go Corrects generated path attribution.
internal/​slicer/​slicer_test.go Verifies generated and extracted ownership behavior.

🧠 Review effort: Lite


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

@lczyk lczyk added the Bug An undesired feature ;-) label Oct 10, 2026
@lczyk lczyk changed the title fix: manifest attribution of until mutate listers for generated content fix: manifest attribution of until: mutate Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug An undesired feature ;-)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants