Skip to content

[Feature]: Virtual Filesystem Layer for Archive Contents #59

Closed

Description

@scttfrdmn

Phase: 1.1 Archive-Aware Filesystem (Week 2)

Goal: Mount archive contents as virtual directories accessible through FUSE.

Implementation:

  • Path translation: /path/archive.tar.zst/file.txt → archive entry
  • Virtual directory handling for archives
  • Stat operations for archived files
  • Seamless integration with existing FUSE layer

Files to create:

  • internal/archive/vfs.go
  • internal/archive/path_translator.go

Dependencies: Archive indexing (Phase 1.1 Week 1)

Success Metrics: Transparent archive navigation, correct file metadata

Personas: All research personas

Activity

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

    @scttfrdmn
    OwnerAuthor

    Resolved in commit 64866e0. pkg/archive/ has been committed to main with ArchiveMetadata, ArchiveIndex, and ArchiveEntry types, plus IsArchive() format detection for tar.zst, tar.gz, and tar.bz2. These provide the objectfs-side metadata types for CargoShip archive integration.

  3. scttfrdmn commented on Feb 22, 2026

    @scttfrdmn
    OwnerAuthor

    Fully implemented in 171a860. The internal/archive package provides the complete VFS layer specified in the issue:

    path_translator.go — Translate(fuseRelPath) scans path segments left-to-right and splits at the first known archive extension, producing a ParsedPath with ArchiveKey, InnerPath, and ArchiveFormat. Supports tar.zst, tar.gz, .tgz, tar.bz2.

    vfs.go — VFS backed by types.Backend:

    • Stat(ctx, archiveKey, innerPath) → *types.ObjectInfo for archive root (virtual dir), explicit dir entries, implicit virtual dirs, and files; returns ErrNotFound when entry is absent
    • ReadDir(ctx, archiveKey, innerPath) → direct children with deduplication; synthesises virtual directory entries for archives created without explicit dir records (common with plain tar cf)
    • ReadFile(ctx, archiveKey, innerPath, offset, size) → decompressed file content; per-entry content cache for repeated reads; Invalidate(archiveKey) clears both index and content caches

    Decompressor support: zstd (klauspost/compress/zstd), gzip (stdlib), bzip2 (stdlib)

    28 race-clean unit tests covering all three formats, virtual directory detection, offset/size slicing, beyond-EOF reads, caching behaviour, and Invalidate.

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: archivearea: fuseeffort: mediumpersona: all-personasphase: v0.5.0-advancedpriority: hightype: enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions