Literate AI

Repository documentation

ADR 0045: Construct and inspect Debian packages on compatible workers

Context

The package-apt Flavor promises a deterministic Debian binary package, but the current adapter produces a ZIP containing DEBIAN/control. It neither constructs a .deb nor asks Debian tooling to inspect one. Its control file also declares Architecture: all without proving platform independence and cannot derive installable Debian dependency coordinates from human-facing runtime requirement names.

Package orchestration has another custody mismatch. It can select and observe a Linux worker for the accepted build lifecycle, then returns to the controller to construct native package bytes. A macOS or Windows controller therefore cannot truthfully satisfy an apt request even when the selected worker has the required Debian tools. Merely replacing the ZIP writer on the controller would preserve that contradiction.

The accepted PackagePlan already binds the Component lock, target, artifact graph, logical inputs, entrypoints, runtime requirements and packager identity. Provider-native path, architecture, dependency and tool decisions must become exact derived authority rather than ambient choices made after the plan is accepted.

Decision

Derive an exact Debian projection before construction

Add a typed Debian projection that is included in the apt packager identity and whose generated control bytes are an exact PackageInput. It binds:

An external runtime requirement without one unambiguous accepted Debian coordinate is a typed refusal. Display names such as locked root language runtime are never converted into package names by string guessing. Duplicate, reserved, case-fold-colliding or escaping installed paths are refused before staging.

Bind native tooling and deterministic inputs

Introduce a dpkg-deb tool binding containing the resolved executable path, executable digest, bounded version probe and fixed arguments. Recheck the executable before and after every invocation. Construction stages only exact plan inputs beneath a fresh directory inside worker OBJ_DIR, assigns declared modes, root ownership metadata and one fixed timestamp, and invokes dpkg-deb with deterministic compression and root-owner-group behavior. Locale, timezone, umask and SOURCE_DATE_EPOCH are fixed and bound by the packager identity.

The staged control archive contains only the generated control file. Maintainer scripts, conffile declarations and triggers are outside this first contract and are refused. Construction never installs, publishes or executes package payloads.

Execute where the package tools and target are valid

Local construction is allowed only when the controller itself is the selected healthy, compatible Linux worker. Otherwise the controller sends a serializable package request through the selected worker transport. The request binds the worker catalog and fresh observation, Debian projection, plan, exact input blob references, deadline and output bounds. The worker returns immutable .deb bytes plus bounded inspection evidence; the controller rehashes both before admitting them to package custody.

Package dispatch uses the production command or SSH actuation boundary from ADR 0044; a controller callback that happens to run locally is not remote evidence. Package bytes remain below worker and controller OBJ_DIR roots, and credentials or private worker locations never enter project authority.

Inspect the complete archive without installing it

Verification starts from the recorded outer digest in a fresh directory. The bound Debian inspection tool emits control fields plus control and filesystem tar streams. The verifier parses those streams without installing or executing the package and requires:

Construction and verification use separate fresh staging roots. Verification does not trust the construction tree, construction command output or the package result's file list in place of inspecting the returned bytes.

Qualification and rollout

Implementation proceeds under the explicit maintainer acceptance recorded on 2026-09-25. Qualification must prove:

Roll out in two reviewable slices: typed projection, bound local tool adapter and real Linux evidence; then production worker dispatch and non-Linux-controller evidence. The roadmap item remains open until both slices and independent verification are complete.

Consequences

The apt provider becomes a real target-specific package adapter rather than a generic metadata archive. This adds Debian-specific projection and worker execution contracts, but keeps the provider-neutral PackagePlan and release result boundary intact.

Requiring exact Debian dependency coordinates may initially refuse packages whose accepted SBOM lacks provider mapping. That refusal is more accurate than publishing a package with guessed or omitted dependencies. Supporting additional distributions or maintainer scripts requires a later explicit contract rather than weakening this one.

Read the Markdown sourceConference homePublished 1.3.0 · Patch 1.3.1 in progress · Development 1.4