Skip to content

Add deterministic tar and gzip utilities for OCI skills#22

Merged
JAORMX merged 1 commit intomainfrom
oci-skills-reproducible-archives
Feb 6, 2026
Merged

Add deterministic tar and gzip utilities for OCI skills#22
JAORMX merged 1 commit intomainfrom
oci-skills-reproducible-archives

Conversation

@JAORMX
Copy link
Contributor

@JAORMX JAORMX commented Feb 6, 2026

Summary

  • Add tar.go: reproducible tar creation with sorted entries, normalized headers (UID/GID=0, PAX format, epoch timestamps). Extraction rejects symlinks, hardlinks, device entries, and path traversal. Per-file size limit (100MB)
  • Add gzip.go: reproducible gzip with fixed headers (OS=255, empty name/comment, BestCompression). Decompression with size limit (100MB). Convenience CompressTar/DecompressTar helpers
  • Comprehensive tests for both (~470 lines of tests)

These are foundational utilities for the skill packager (next PR). No new dependencies added.

Part of #16

Test plan

  • task passes (lint + test)
  • task license-check passes
  • Reproducibility verified: same input always produces identical output
  • Security tests: symlinks, hardlinks, device entries, path traversal all rejected
  • Decompression bomb protection tested

🤖 Generated with Claude Code

Add reproducible archive creation and extraction utilities to the
oci/skills package. These are foundational for the skill packager.

tar.go: Deterministic tar creation with sorted entries, normalized
headers (UID/GID=0, PAX format, epoch-based timestamps). Extraction
rejects symlinks, hardlinks, device entries, and path traversal.
Per-file size limit (100MB) prevents decompression bombs.

gzip.go: Deterministic gzip compression with fixed headers (OS=255,
empty name/comment, BestCompression). Decompression with size limit
(100MB) prevents decompression bombs. Convenience CompressTar and
DecompressTar for combined tar.gz operations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JAORMX JAORMX requested review from jhrozek and rdimitrov February 6, 2026 19:19
@JAORMX JAORMX merged commit be33c9c into main Feb 6, 2026
5 checks passed
@JAORMX JAORMX deleted the oci-skills-reproducible-archives branch February 6, 2026 19:29
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.

2 participants