Skip to content

fix(frontend): remove inherited descriptors during publication - #143

Merged
cdupuis merged 3 commits into
mainfrom
fix/resolve-set-descriptor
Oct 26, 2026
Merged

cdupuis merged 3 commits into
mainfrom
fix/resolve-set-descriptor

Conversation

@cdupuis

@cdupuis cdupuis commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Recipe-built kits can inherit staged descriptors through FROM. Claude 2.1.310 inherited DHI's sbx-templates/kit.yaml, so a set build found several descriptors and could not identify the kit being composed (docker/sbx-kits-contrib#426).

Before staging a recipe-built kit's own guidance and sources, remove inherited /usr/share/sandbox/kit/*/kit.yaml files. Keep inherited guidance, recipes, and payload files, and leave ordinary bases without staged sources alone. Builds using kits: skip cleanup and preserve their listed kits' sources, as required by SPEC-v3 §10/merged-set-carries-sources. No descriptor grammar, normative statement, or conformance duty changes.

The set reader keeps its existing path. This implementation needs no extra registry requests or BuildKit upgrade; private registries use the builder's existing authentication, mirror, and certificate configuration. Previously published images carrying inherited descriptors must be rebuilt with the updated frontend before they can be listed in a set. This replaces the earlier consumer-side implementation; BuildKit #7324 is no longer a prerequisite.

Regression coverage builds a workload FROM a merged set, publishes bare-manifest and annotated-index variants, then composes them into sets. It checks declaration isolation, create-phase argument expansion, removal of inherited descriptors, preservation of inherited guidance/recipes/payloads, and preservation of member sources in newly published sets. A separate test builds FROM and composes private images through an authenticated TLS mirror, with credentials only in the build session and the CA only in builder configuration. The regression reproduces #426 with cleanup disabled and passes with cleanup enabled on unmodified builders, including Docker's BuildKit v0.33.1.

Validation passed: task validate, task lint, task test, and task test:e2e. task kits:dev built hello, then stopped while extracting the gh example's Nix base because the Docker daemon ran out of storage.

Fixes docker/sbx-kits-contrib#426 after affected images are rebuilt.

Release note

Recipe-built kits remove inherited staged descriptors during publication so rebuilt images can be composed into sets with current builders, including private registries.

Images built FROM another kit and merged sets legitimately carry several staged descriptors. Identify the contribution by matching the published annotation at the image pin, preserving inherited sources and refusing ambiguous matches. Keep the single-source path local, and document the registry-access boundary of the extra metadata lookup.

Signed-off-by: Christian Dupuis <cd@docker.com>
@cdupuis
cdupuis requested a review from a team as a code owner October 26, 2026 14:55
Copilot AI balanced review requested due to automatic review settings October 26, 2026 14:55

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.

🟡 Changes recommended

Collision checks omit inherited source roots, allowing outer sets to overwrite inherited kit descriptors.

1 open issue
What changed in this PR

This PR enables set composition from images carrying inherited kit sources or merged sets by matching their published descriptor to a staged source root.

Changes:

  • Resolve published metadata at the pinned digest and requested platform while preserving the single-descriptor path.
  • Add registry transport support, a frontend CA bundle, and documentation of anonymous-access limitations.
  • Add unit and end-to-end coverage for descriptor selection, nested sets, and inherited sources.
File Description
README.md Documents descriptor selection and registry-access limitations.
Dockerfile Includes trusted CA certificates for metadata requests.
cmd/​frontend/​set.go Resolves published identity when multiple descriptors are staged.
cmd/​frontend/​set_e2e_test.go Covers inherited workloads and nested set composition.
cmd/​frontend/​kit_descriptor.go Implements pinned metadata lookup and staged descriptor matching.
cmd/​frontend/​kit_descriptor_test.go Tests identity matching, platform selection, and lookup restrictions.

Review effort: Balanced

Comment thread cmd/frontend/set.go Resolved
Resolve every descriptor manifest through BuildKit ImageBlob so private registry credentials, mirrors, custom CAs, and the builder network are shared with the image pull. Remove the anonymous HTTP fallback and frontend CA bundle. Exercise the boundary with an isolated credential session and a private TLS mirror for both bare manifests and annotated indexes.

Full OCI manifest support depends on moby/buildkit#7324; keep the pull request in draft until that prerequisite is available.

Signed-off-by: Christian Dupuis <cd@docker.com>
Copilot AI balanced review requested due to automatic review settings October 26, 2026 16:31

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.

🔵 Needs a closer look

The reported inherited-root collision gap remains unresolved and can allow composition to overwrite staged source descriptors.

1 open issue

Review effort: Balanced

Recipe-built kits inherit their base filesystem without inheriting its declarations. Remove inherited staged descriptors before adding this kit's guidance and sources, while preserving the other inherited files. Set builds retain their members' staged sources as required by the specification.

Replace the set-side manifest lookup with publication cleanup so private registries work with current builders and no BuildKit upgrade is required. Published images affected by contrib issue 426 need rebuilding with the updated frontend.

Signed-off-by: Christian Dupuis <cd@docker.com>
Copilot AI balanced review requested due to automatic review settings October 26, 2026 17:14
@cdupuis cdupuis changed the title fix(frontend): resolve published descriptors when composing kit sources fix(frontend): remove inherited descriptors during publication Oct 26, 2026
@cdupuis
cdupuis marked this pull request as ready for review October 26, 2026 17:14

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

The cleanup is narrowly scoped, preserves set member sources, and has targeted regression coverage with no unresolved findings.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@cdupuis
cdupuis merged commit b917b97 into main Oct 26, 2026
8 checks passed
@cdupuis
cdupuis deleted the fix/resolve-set-descriptor branch October 26, 2026 17:57
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.

sbx-kit-claude:latest (2.1.310) can no longer be listed in a kind: set ("carries staged sources for 2 kits")

2 participants