oci: extract artifact-agnostic primitives into oci/artifact (Phase 0, THV-0077)#133
Merged
Merged
Conversation
Phase 0 of plugin support (THV-0077). Move the artifact-agnostic OCI primitives out of oci/skills into a new oci/artifact package so a future oci/plugins can reuse them: - tar (CreateTar/ExtractTar*/FileEntry/TarOptions, MaxTarFileSize) - gzip (Compress/Decompress*/CompressTar/DecompressTar, MaxDecompressedSize) - platform helpers (PlatformString/ParsePlatform/DefaultPlatforms, OS/Arch) - pull-hardening, exported as ValidatingTarget/NewValidatingTarget plus the manifest/blob size caps and manifest-count limits oci/skills re-exports every moved symbol via type aliases, var-forwarding, and const re-declaration (oci/skills/artifact_aliases.go), so the package's public surface is unchanged and downstream consumers (toolhive) are unaffected — no exported signature changed. Behavior-preserving move: function bodies are identical and the oci/skills determinism tests still assert byte-stable artifact digests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jhrozek
reviewed
Jun 16, 2026
jhrozek
left a comment
Contributor
There was a problem hiding this comment.
Batched review from /review-iterate on the oci/artifact extraction. These are non-blocking (the refactor itself is sound — build/vet/test/lint/license all pass and the security posture is preserved). Findings cluster on the back-compat alias layer for an Alpha package, plus two pre-existing path-handling issues carried over by the tar.go rename. Test-coverage gaps from the review were noted but not commented inline.
jhrozek
approved these changes
Jun 18, 2026
jhrozek
left a comment
Contributor
There was a problem hiding this comment.
All 5 commented findings addressed. LGTM.
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.
Phase 0 of plugin support (RFC THV-0077)
Extracts the artifact-agnostic OCI primitives out of
oci/skillsinto a newoci/artifactpackage so the upcomingoci/pluginspackage can reuse them. Behavior-preserving refactor — no logic changes.What moved to
oci/artifactCreateTar/ExtractTar/ExtractTarWithLimit,FileEntry,TarOptions/DefaultTarOptions,MaxTarFileSize, path-traversal/symlink rejectionCompress/Decompress/DecompressWithLimit,CompressTar/DecompressTar,GzipOptions/DefaultGzipOptions,MaxDecompressedSize(decompression-bomb guard)PlatformString/ParsePlatform/DefaultPlatforms+ OS/Arch constsValidatingTarget/NewValidatingTarget(+ manifest/blob size caps and manifest-count limits, digest verification)Backward compatibility
oci/skillsre-exports every moved symbol via type aliases (type X = artifact.X),var-forwarding for funcs, and const re-declaration (oci/skills/artifact_aliases.go). The public surface ofoci/skillsis unchanged — no exported signature changed, and downstream consumers (toolhive) are unaffected. The skills determinism tests still assert byte-stable artifact digests, proving published skill digests don't change.Notes
SkillConfig,Packager,Registry,Store) stays inoci/skills.toolhive-core+ bumptoolhive'sgo.mod), which is tracked in the epic.Closes #130
Part of stacklok/toolhive#5525
RFC: stacklok/toolhive-rfcs#77
🤖 Generated with Claude Code