ADR 0005 — Packages are inert, verified archives
Status: accepted (2026-11-24).
- A
.sonatapkgis an uncompressed ustar archive written and read by our own code. It can hold onlypackage.json, Sonata sources insrc/,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 insonata.lock.sonata pkg checkdetects 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
tarcan list an archive for inspection.