From 68d86f2abb60d85401e4521d1d801c0f8c0f952b Mon Sep 17 00:00:00 2001 From: Ersi Ni Date: Sat, 29 Aug 2026 19:08:37 +0100 Subject: [PATCH 1/3] docs(design): specify Debian container APT package archive caching fix --- .../2026-08-29-ci-debian-package-cache-fix.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 docs/design/2026-08-29-ci-debian-package-cache-fix.md diff --git a/docs/design/2026-08-29-ci-debian-package-cache-fix.md b/docs/design/2026-08-29-ci-debian-package-cache-fix.md new file mode 100644 index 0000000..83afde6 --- /dev/null +++ b/docs/design/2026-08-29-ci-debian-package-cache-fix.md @@ -0,0 +1,39 @@ +# Spec: Debian Container Package Cache Fix + +**Date:** 2026-08-29 +**Status:** Approved design, entering implementation +**Author:** Pair Programming Session (Superpowers) +**Related Design Documents:** +- [CI Latency and Test Harness Optimization (Phase 2)](2026-08-29-ci-latency-and-test-harness-optimization-phase-2.md) +- [Spec 5 — verification gate](2026-08-11-spec-5-verification-gate.md) + +--- + +## 1. Problem Statement + +In `linux-stage-zero` container jobs in `.github/workflows/verify.yml`, `actions/cache` was configured to cache `/var/cache/apt/archives` on Debian and `/var/cache/pacman/pkg` on Arch Linux. + +While Arch Linux successfully saved and restored ~195 MB of package archives, Debian saved only 394 bytes (an empty directory metadata tarball). + +**Root Cause:** +Official Docker Debian images (`debian:stable-slim`) ship with a default `/etc/apt/apt.conf.d/docker-clean` configuration that hooks `DPkg::Post-Invoke` and `APT::Update::Post-Invoke` to automatically delete all `.deb` archives in `/var/cache/apt/archives/` after every `apt-get` execution. + +--- + +## 2. Solution + +In `.github/workflows/verify.yml`, update the Debian matrix entry under `linux-stage-zero` to remove `/etc/apt/apt.conf.d/docker-clean` and configure APT to keep downloaded archives: + +```yaml + - image: debian:stable-slim + pkg_cache: /var/cache/apt/archives + prereqs: rm -f /etc/apt/apt.conf.d/docker-clean && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache && apt-get update -qq && apt-get install -y -qq sudo golang-go git ca-certificates curl +``` + +--- + +## 3. Invariants & Verification + +1. **Clean Container Fidelity:** `stageZero` in `packages.go` continues to run real package installations and verify required tool binaries (`gcc`, `file`, etc.). +2. **Security & Pinning:** `actions/cache` remains pinned to `55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0`. +3. **Workflow Syntax:** Workflow YAML syntax validated. From 681dbf314fa6475e1f799ca4c8ff5f4e70265bef Mon Sep 17 00:00:00 2001 From: Ersi Ni Date: Sat, 29 Aug 2026 19:08:42 +0100 Subject: [PATCH 2/3] docs(plans): plan Debian container package cache fix --- .../2026-08-29-ci-debian-package-cache-fix.md | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docs/plans/2026-08-29-ci-debian-package-cache-fix.md diff --git a/docs/plans/2026-08-29-ci-debian-package-cache-fix.md b/docs/plans/2026-08-29-ci-debian-package-cache-fix.md new file mode 100644 index 0000000..27cbb8c --- /dev/null +++ b/docs/plans/2026-08-29-ci-debian-package-cache-fix.md @@ -0,0 +1,45 @@ +# Debian Container Package Cache Fix Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Ensure Debian `.deb` packages are retained in `/var/cache/apt/archives` during `linux-stage-zero` container runs so that `actions/cache` can save and restore them across workflow runs. + +**Architecture:** In `.github/workflows/verify.yml`, remove `/etc/apt/apt.conf.d/docker-clean` and set `Binary::apt::APT::Keep-Downloaded-Packages "true"` in Debian's `prereqs` matrix string before executing `apt-get`. + +**Tech Stack:** GitHub Actions YAML, Debian APT, `actions/cache@v6.1.0` + +**Spec:** [docs/design/2026-08-29-ci-debian-package-cache-fix.md](file:///Users/nilbot/dotfiles/docs/design/2026-08-29-ci-debian-package-cache-fix.md) + +--- + +### Task 1: Update Debian Prerequisites in `.github/workflows/verify.yml` + +**Files:** +- Modify: `.github/workflows/verify.yml:295-310` + +- [ ] **Step 1: Update Debian `prereqs` in `linux-stage-zero` matrix** + +In `.github/workflows/verify.yml`: +```yaml + - image: debian:stable-slim + pkg_cache: /var/cache/apt/archives + prereqs: rm -f /etc/apt/apt.conf.d/docker-clean && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache && apt-get update -qq && apt-get install -y -qq sudo golang-go git ca-certificates curl +``` + +- [ ] **Step 2: Commit workflow changes** + +```bash +git add .github/workflows/verify.yml +git commit -m "ci(verify): preserve Debian apt package archives in linux-stage-zero" +``` + +--- + +### Task 2: Verification + +**Files:** +- Verification only + +- [ ] **Step 1: Validate YAML and run local tests** +Run: `(cd agents && go test -count=1 ./...) && (cd bootstrap.d && go test -count=1 ./...)` +Expected: PASS From 7855aa80b582ee5d7ec19342baf1fb761a37b069 Mon Sep 17 00:00:00 2001 From: Ersi Ni Date: Sat, 29 Aug 2026 19:10:27 +0100 Subject: [PATCH 3/3] ci(verify): preserve Debian apt package archives in linux-stage-zero --- .github/workflows/verify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index f94fa79..3189560 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -298,7 +298,7 @@ jobs: include: - image: debian:stable-slim pkg_cache: /var/cache/apt/archives - prereqs: apt-get update -qq && apt-get install -y -qq sudo golang-go git ca-certificates curl + prereqs: rm -f /etc/apt/apt.conf.d/docker-clean && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache && apt-get update -qq && apt-get install -y -qq sudo golang-go git ca-certificates curl - image: archlinux:base pkg_cache: /var/cache/pacman/pkg # DisableSandbox under [options], and it must be under [options]: