Skip to content

Validate final release archives #74

Closed

Description

@mowind

Part of #70.

Goal

Add safe internal tar.gz and zip artifact-bundle adapters that validate the final release archive before any binary is executed.

Scope

  • Own the closed seven-target map and target-to-archive-class mapping.
  • Preflight every archive member before extraction.
  • Accept exactly four root-level regular binaries with the required Unix or Windows names and no extras.
  • Normalize / and \\; reject absolute, UNC, drive-qualified, traversal, trailing-dot/space alias, case-fold collision, duplicate, link, special, encrypted, corrupt, and resource-limit violations.
  • Extract members one by one into an owned temporary directory; do not use unrestricted extractall().
  • Preserve Unix executable bits and use Windows .exe regular-file semantics without requiring POSIX mode bits.
  • Classify malformed CLI/unknown target/unsupported target-suffix pairing as exit 2, and a valid-class defective archive as evidence failure exit 1.

Acceptance Criteria

  • Pure fixture tests cover good tar.gz/zip archives and every rejected member/namespace class.
  • Unknown or misspelled targets fail closed.
  • Caller archives are never modified or deleted.
  • The adapter never falls back to pre-archive OUT_DIR.

Activity

  1. mowind commented on Aug 4, 2026

    @mowind
    OwnerAuthor

    Implemented in commit bb28214. Added bounded tar.gz/zip adapters with full preflight, canonical namespace checks, exact four regular binaries, traversal/absolute/drive/alias/case collision rejection, tar link/special/executable checks, zip encryption/symlink checks, safe one-by-one extraction, cleanup, and usage/evidence error classes with fixture tests.

  2. mowind commented on Aug 4, 2026

    @mowind
    OwnerAuthor

    Closed by bb28214.

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

    ready-for-agentFully specified and ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions