Skip to content

[Feature]: Archive Detection and Indexing for TAR.ZST files #58

Closed

Description

@scttfrdmn

Phase: 1.1 Archive-Aware Filesystem (Week 1)

Goal: Detect TAR.ZST archives in S3 and build in-memory index of contents.

Implementation:

  • Detect .tar.zst files during bucket listing
  • Parse TAR headers to build file index
  • Cache archive metadata in memory
  • Support archive enumeration

Files to create:

  • internal/archive/detector.go
  • internal/archive/index.go
  • pkg/archive/metadata.go

Dependencies: v0.4.0 shared component library, Go tar/zstd libraries

Success Metrics: Index 1000-file archive in <1 second, <100MB memory per archive

Personas: Computational Biologist, Physics Researcher, Data Engineer

Activity

  1. added
    type: enhancement
    priority: high
    area: archive
    persona: computational-biologist
    persona: physics-researcher
    phase: v0.5.0-advanced
    effort: medium
    on Nov 4, 2025
  2. scttfrdmn commented on Feb 22, 2026

    @scttfrdmn
    OwnerAuthor

    Implemented in commit fd604a3.

    New files:

    • internal/archive/detector.go — Detect, DetectKeys, DetectInPrefix, IsArchiveKey
    • internal/archive/index.go — BuildIndex (downloads via backend + supplements with HeadObject), BuildIndexFromBytes (walks tar headers without retaining data), openTar (shared decompressor factory for zstd/gzip/bzip2)
    • internal/archive/index_test.go — 21 tests covering all code paths (format detection, file/dir entries, root . skip, unsupported format, corrupt data, empty archive, HeadObject supplement, HeadObject failure non-fatal, 1000-file smoke test)
    • internal/archive/detector_test.go — 14 tests covering Detect, DetectKeys, DetectInPrefix, IsArchiveKey

    Modified:

    • internal/archive/vfs.go — getIndex now delegates to BuildIndex; openTar removed (moved to index.go, still accessible within the package)
    • pkg/archive/metadata.go — minimum-length guard in IsArchive lowered from 7 → 5 to correctly recognise .tgz filenames with single-character base names (e.g. a.tgz)

    All 56 internal/archive unit tests pass with -race.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: archiveeffort: mediumpersona: computational-biologistpersona: physics-researcherphase: v0.5.0-advancedpriority: hightype: enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions