SPB Git

Repository Public

0005-packages.md 1.4 KB

# ADR 0005 — Packages are inert, verified archives

Status: accepted (2026-11-24).

  • A .sonatapkg is an uncompressed ustar archive written and read by our own code. It can hold only package.json, Sonata sources in src/, examples/, tests/, and plain documentation.
  • No install script, no executable content. Installing copies text files; nothing from a package is ever run. The language itself has no file, network or process access.
  • Reading refuses the whole archive on any link, device, absolute or .. path, hidden file, duplicate, oversize or unknown location, before anything is written. Extraction never follows a name from the archive without re-validating it.
  • Every file is pinned by SHA-256 in MANIFEST.sha256; the archive's own SHA-256 is recorded in sonata.lock. sonata pkg check detects modified, missing and extra files.
  • Resolution is local and deterministic (highest version satisfying every requirement, one version per package). There is no registry and no download in this version; a registry would be an optional source of archives verified by the same code.
  • tar was chosen over zip because a strict reader and a deterministic writer fit in a few hundred lines without a dependency, and the system tar can list an archive for inspection.
Files main
Menu

Theme