Add skill installer and extractor for OCI artifact extraction#3835
Merged
Add skill installer and extractor for OCI artifact extraction#3835
Conversation
Contributor
There was a problem hiding this comment.
Large PR Detected
This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.
How to unblock this PR:
Add a section to your PR description with the following format:
## Large PR Justification
[Explain why this PR must be large, such as:]
- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformationAlternative:
Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.
See our Contributing Guidelines for more details.
This review will be automatically dismissed once you add the justification section.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3835 +/- ##
========================================
Coverage 66.71% 66.72%
========================================
Files 443 444 +1
Lines 43847 44060 +213
========================================
+ Hits 29254 29398 +144
- Misses 12306 12355 +49
- Partials 2287 2307 +20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jhrozek
previously approved these changes
Feb 17, 2026
Implement the skill installer that extracts OCI artifact layers to client skill directories with security validation and managed/unmanaged detection. Key changes: - Add Extract() and Remove() in pkg/skills/installer.go for filesystem operations with defense-in-depth security (path traversal prevention, symlink validation, permission sanitization, size/count limits) - Add PathResolver interface to decouple pkg/skills from pkg/client - Update skillsvc with functional options pattern (WithPathResolver) and full Install/Uninstall logic including upgrade detection and file cleanup for all clients on uninstall - Wire PathResolver via clientPathAdapter in API server - Expose Client and Force fields in install API request Closes #3649 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add symlink protection to Remove using Lstat/EvalSymlinks - Fix cross-platform root detection (filepath.Dir/VolumeName) - Make Uninstall cleanup best-effort with errors.Join - Roll back extraction on store Create/Update failure - Introduce Installer interface for DI and testability Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bf0362f to
d5e3fd9
Compare
jhrozek
approved these changes
Feb 17, 2026
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.
Closes #3649
Why
This is the critical-path task for the Skills Lifecycle Management epic — all remaining skill tasks are blocked on having an installer that can extract OCI artifact content to disk and clean up on uninstall.
Today,
Install()only creates a pending DB record andUninstall()only deletes it. Neither touches the filesystem.What
Filesystem operations (
pkg/skills/installer.go):Extract()decompresses tar.gz OCI layers to client skill directories with size limits (500MB total, 100MB/file, 1000 files max) and permission sanitization (setuid/setgid stripped, capped at 0644)Remove()safely deletes skill directories with guards against dangerous pathsService layer (
pkg/skills/skillsvc/):Install()now handles managed/unmanaged detection (same digest = no-op, different digest = upgrade, unmanaged dir on disk = refuse unless--force)Uninstall()removes files for all clients before deleting the DB recordWithPathResolver) keeps the service extensible for Skill service implementation #3650 (OCI store/registry)Wiring:
PathResolverinterface inpkg/skills/avoids thepkg/skills↔pkg/clientimport cycleclientPathAdapterinpkg/api/server.gobridges*client.ClientManagertoPathResolverLayerData/Reference/Digestare internal-only fields (json:"-") — not exposed via HTTP API. The API path still creates pending records; extraction is only reachable from internal code (OCI pull in Skill service implementation #3650)Large PR Justification
This touched the API so the swagger occupies some space.
🤖 Generated with Claude Code