These docs are under active development and cover the v0.20 Kobicha security model.
§1.1 1 Introduction

Scope

This specification defines peipkg, the package format and repository protocol for the Peios operating system. peipkg is the binary distribution primitive -- the unit of build, distribution, and trust for software shipped to a Peios system.

peipkg is intentionally narrow in scope. It defines how binaries reach a system; it does not define how those binaries are integrated into services, applications, roles, or features. Higher-level concepts (roles, role features, core features, CLI applets, GUI applets) reference packages but are specified separately. A package is an implementation detail beneath these user-facing primitives.

This specification covers:

  • The on-wire package format -- container, internal layout, manifest schema
  • Package identity -- naming, versioning, architecture
  • Dependency expression and resolution semantics
  • Declarative side-effect mechanisms for standard Linux maintenance operations (ldconfig, depmod, man-db)
  • Per-file and per-package integrity
  • Package signing -- algorithms, envelope, verification
  • Repository protocol -- descriptor, active and archive indexes, URL conventions
  • Repository trust model -- signing policy, custom repositories
  • Package manager semantics -- install, upgrade, uninstall, transactions, rollback

This specification does not cover:

  • Roles, role features, or core features (separate subsystems, to be specified)
  • CLI applets and GUI applets (separate subsystem, to be specified)
  • Integration metadata that higher-level artifacts attach to packages -- peinit service descriptors, KACS security descriptors, LCS registry seeds, reconciller manifests -- these belong to the artifacts that compose packages, not to packages themselves
  • The build infrastructure that produces packages (operational; see appendix A for guidance)
  • KACS security descriptors and xattrs applied to installed files -- PSD-004
  • LCS registry interactions during install -- PSD-005
  • peinit lifecycle integration of installed services -- PSD-007
§1.2 1 Introduction

Terminology

This specification introduces terms specific to package management. Terms defined in other PSDs are used here with the same meaning and are not redefined.

  • Package: A signed binary distribution artifact. The unit of build, distribution, and installation. A package contains one or more files, metadata describing its identity and dependencies, and a signature.

  • peipkg: This specification, the package format it defines, and the package manager tool that consumes the format. Where ambiguous, the spec uses "the format", "the protocol", or "the tool" to disambiguate.

  • Manifest: A JSON document inside each package that declares its identity, dependencies, side-effect requirements, and payload integrity. The manifest is the authoritative metadata for a package.

  • Repository (repo): A collection of packages addressable as a unit. A repo is identified by its descriptor URL.

  • Repo descriptor: A small JSON document at a well-known path within a repository describing the repo's identity, signing key, and pointers to its indexes.

  • Index: A signed JSON document listing the packages available in a repository. Each repository has an active index and an archive index.

  • Active index: The index listing the current version of each package. The default index for routine operations.

  • Archive index: The index listing every version of every package ever shipped by a repository. Used for downgrade, version pinning, and forensic queries.

  • Side-effect declaration: A flag in the manifest indicating that a standard Linux maintenance operation (ldconfig, depmod, man-db) is to be invoked after install. The complete set of declarable side-effects is enumerated normatively (§4.3).

  • Custom repository: A repository hosted by a party other than the official Peios project. Custom repositories use the same protocol and trust model as the official repository.

  • Build farm: The infrastructure that produces packages. Operational concerns are out of scope for this specification (see appendix A).

  • Epoch, upstream version, peios revision: The three components of a package version string. Defined in §2.2.

§1.3 1 Introduction

Conventions

This specification conforms to PSD-001.

The key words MUST, MUST NOT, SHOULD, SHOULD NOT, and MAY in this specification are to be interpreted as described in RFC 2119.

JSON documents specified herein conform to RFC 8259. Field names are lowercase with underscores between words (schema_version, not schemaVersion). Unknown fields MUST be ignored on parse to permit forward-compatible extension (with the explicit exception of the signature envelope, §5.1.3, which mandates strict parsing). Field order is not significant.

JSON consumers in this specification MUST harden their parsers against malformed and adversarial input:

  • Duplicate keys in any object MUST cause the document to be rejected. Parsers that silently take first-wins or last-wins are not compliant.
  • Integer fields MUST fit in unsigned 64-bit range and MUST NOT use exponent notation.
  • JSON nesting depth MUST be capped at 64; documents exceeding this depth MUST be rejected.
  • String values MUST NOT exceed the document size limit applicable to their containing artifact (per the resource-limit table where one applies).
  • Unicode escapes within strings MUST resolve to a valid Unicode code point per RFC 8259 §7.

Hash values are encoded in lowercase hexadecimal unless otherwise stated. Hash algorithms are identified by their IANA-registered names (SHA-256, BLAKE3).

Signatures use Ed25519 as defined in RFC 8032 unless otherwise stated. Signature values are encoded in base64 (RFC 4648 §4) without padding.

Strings are UTF-8 encoded (RFC 3629). String comparisons in this specification use byte-for-byte equality unless otherwise stated.

URLs follow RFC 3986. Relative URLs in repository indexes are resolved against the repository descriptor URL.

Compression uses the Zstandard format (RFC 8478). The specification does not constrain compression level; producers SHOULD use a level that yields reproducible output for a given input.

§1.4 1 Introduction

Prior Art

peipkg draws on established package management conventions from multiple ecosystems. The container format is closest to Arch's pkg.tar.zst; the version model is closest to Debian; the repository protocol is closest to pacman's repo database. None of these models is adopted wholesale -- each was chosen for the specific concerns it solves well.

§1.4.1 Arch Linux

Arch's package format (pkg.tar.zst) is the structural inspiration for the peipkg container (§3.1). Both use a tarball compressed with Zstandard, with metadata files at known paths inside the archive and deterministic file ordering for reproducibility.

peipkg diverges from Arch's format in three ways:

  • Arch uses ad-hoc key=value text files (.PKGINFO, .MTREE) for metadata; peipkg uses JSON.
  • Arch's package signature is detached (a separate .sig file alongside the package); peipkg signatures are inline (a signature file inside the archive, signing everything before it).
  • Arch repositories are rolling-only with no first-class archive of historical versions; peipkg requires retention of every version ever shipped (§6.3).

§1.4.2 Debian

Debian's version scheme ([epoch:]upstream_version-debian_revision) is the structural model for peipkg versioning (§2.2). The distinction between epoch, upstream version, and distro revision captures the constraints of repackaging upstream software without a vendor relationship to upstream.

peipkg diverges from Debian in version comparison rules. Debian's algorithm has accumulated edge cases over thirty years; peipkg adopts SemVer-style pre-release ordering rules (§2.2) within the upstream version component to keep comparison predictable.

§1.4.3 pacman repository database

pacman's repository database structure -- a single index file plus per-package files in a predictable directory layout -- is the structural model for the peipkg repository protocol (§6). The protocol is fully static-HTTP-fetchable and requires no server-side computation.

peipkg's index format is JSON rather than a tar of text files. The two-tier active/archive split (§6.2, §6.3) and indefinite version retention (§6.3) are peipkg additions not present in pacman.

§1.4.4 Considered alternatives

OCI registries and npm-style per-package endpoints were considered as repository models. Both were rejected:

  • OCI registries require a server-side protocol implementation, which conflicts with the static-HTTP hosting goal.
  • npm-style per-package endpoints are necessary at scales exceeding a few thousand packages but require many HTTP requests per resolution. peipkg's expected scale (a few hundred to a few thousand packages) does not justify the cost.