Joshua Cox
•⏳ 13 min read•blog

Zero-Server Signed APT, AF_PACKET DHCPv4, Failover Self-Blackhole Guards, 46 Adapter Seams, and Post-Resize Magenta Despill

A 24-hour systems-engineering dispatch: launching a <200 KiB zero-server signed APT repository on GitHub Pages + Cloudflare 302 redirects and squashing four firstboot races for v0.16.8–v0.16.9; closing six bare-metal Linux edge traps including raw AF_PACKET DHCPv4, SO_RCVTIMEO {0,0} infinite blocks, T1/T2 lease renewals, VRRP self-blackhole guards, and netns Confirm gates; hardening all 46 security audit seams in the Paperclip adapter and plugin; landing 11 upstream runtime PRs plus live K8s studios; and shipping 154 painted 2D storybook assets with post-resize magenta despill and 40/40 passing Godot scenes.

Zero-Server Signed APT, AF_PACKET DHCPv4, Failover Self-Blackhole Guards, 46 Adapter Seams, and Post-Resize Magenta Despill

Steady state rarely breaks a system. Transitions do.

Fresh images boot before sshd finishes generating host keys. An edge firewall grabs a DHCP lease once at PID 1 boot, throws away the timer, and goes dark days later at T1. A protojson unmarshal failure leaves dirty fields on a struct before falling back to encoding/json. An AI agent adapter validates a loopback URL with .local mDNS enabled, or strips dangerous environment variables everywhere except the actual spawn boundary. Even a 2D sprite pipeline breaks on transition: key out a magenta background before downscaling and bilinear resampling happily paints fresh pink halos right back onto every anti-aliased edge.

Over the past 24 hours across five parallel engineering tracks, the unifying theme was transition-safe engineering: locking down firstboot races, lease renewals, VRRP failovers, sandboxed process spawns, and asset downscaling so systems stay honest when state changes.

24-Hour Systems Engineering Pulse for Dec 4 to Dec 5, 2026 covering Zero-Server Signed APT and v0.16.8–v0.16.9 firstboot fixes, Raw AF_PACKET DHCPv4 and six Linux failover traps, 46 Paperclip adapter security seams, 11 upstream runtime PRs plus live cluster studios, and 154 painted storybook assets with post-resize magenta despill


1. Zero-Server Signed APT (apt.axonwall.com) & Four Firstboot Races (v0.16.8–v0.16.9)

Hosting an official Debian/Ubuntu APT repository usually means maintaining an S3 bucket, a persistent VPS running reprepro, or both. In axonwall/apt (5e5cb8a, 1,545 lines across 9 files) paired with axonwall/axonwall (d26b08c6), we eliminated the origin server completely using a split-plane zero-server APT architecture:

  • Metadata Plane (< 200 KiB on GitHub Pages): A Python builder (scripts/build-apt-repo.py, 813 lines) fetches the latest 5 stable v* releases plus rolling-latest from GitHub Releases, verifies every .deb against its .deb.sha256 and .deb.sha256.sig using keys/release-signing/release-signing.pub, extracts control metadata, and generates GPG-signed dists/trixie, dists/stable, and dists/rolling indexes plus axonwall-archive-keyring.gpg. Zero .deb payloads ever touch GitHub Pages.
  • Payload Plane (Cloudflare 302 → GitHub Releases): Cloudflare serves /dists/* and keyrings directly from GitHub Pages while redirecting https://apt.axonwall.com/pool/*/* with HTTP 302 to https://github.com/axonwall/axonwall/releases/download/${1}/${2}. Because apt natively follows HTTPS redirects and checks the cryptographic InRelease signature + exact package SHA-256 hash before invoking dpkg, trust remains pinned to the signed metadata.
  • Self-Updating Trust: Commit d26b08c6 bundles axonwall-archive-keyring.gpg directly inside .deb builds and dispatches the apt.axonwall.com rebuild workflow automatically on every release.

Dual-panel diagram showing the Zero-Server Signed APT Split Plane across GitHub Releases, CI verification, GitHub Pages metadata, and Cloudflare 302 pool redirects on the left, and four firstboot and packaging race fixes for v0.16.8 and v0.16.9 on the right

Four Firstboot & Packaging Races Squashed (562e4dbc, ff799082)

Before cutting v0.16.8 and v0.16.9, firstboot verification caught four classic boot-order and serialization bugs:

  1. The sshd Hostkey Race: Freshly provisioned appliances could start ssh.service before axonwall-firstboot finished writing or generating SSH host keys. Adding a deterministic systemd drop-in (10-axonwall-hostkeys.conf) with ExecStartPre hostkey generation closes the race window before port 22 opens.
  2. Dirty Struct Leakage in protojson Fallback: In unmarshalApplyBundleHTTP, when protojson.UnmarshalOptions{DiscardUnknown: true} failed on camelCase or legacy JSON payloads and fell back to encoding/json.Unmarshal, partial fields decoded by protojson survived on req. Calling req.Reset() before the fallback—and explicitly hydrating camelCase jobId, bundleHash, nftScript, reloadServices, confirmTimeoutSeconds, signature, and files[].fileMode—fixed /v1/apply, /v1/confirm, and /v1/rollback cleanly.
  3. agent.token 0640 Validation & Boot Unit Enablement: Tightened 0640 token permission checks across firstboot scripts and ensured kea-dhcp4-server and unbound are explicitly enabled across reboots rather than only started during initial provisioning.
  4. Debian 13 Trixie Package Alignment (ff799082): Updated the CrowdSec firewall bouncer plugin manifest from the legacy nftables package suffix to Debian 13's crowdsec-firewall-bouncer.

2. Bare-Metal Edge Routing & HA Failover: Six Brutal Linux Networking Traps

When an edge perimeter runs as a minimal pure-Go PID 1 Unified Kernel Image (UKI) with CONFIG_MODULES=n, there is no dhclient fallback, no shell wrapper to hide behind, and no room for half-configured failover scripts. Deep-dive testing on real WAN/LAN failover transitions surfaced six brutal Linux networking traps—and pushed the verification suite to 380/380 passing @axonwall/lib tests plus full Go satellite and HA failover suites.

Isometric cutaway illustration of a hardened bare-metal edge router and failover architecture showing a cyan Layer-2 raw packet injector, golden VRRP heartbeat bridge with crimson-to-emerald self-blackhole circuit breaker, isolated network namespace probe tunnel, and braided post-quantum cryptographic tunnel ring

Trap 1: AF_PACKET DHCPv4 & the SO_RCVTIMEO {0, 0} Infinite Block

Upstream ISP modems and bridges routinely fail to deliver AF_INET broadcast DHCP offers before an interface holds a configured IPv4 source. Moving the satellite's pure-Go DHCPv4 client to raw AF_PACKET (SOCK_DGRAM, ETH_P_IP) with hand-rolled RFC 1071 inetChecksum(), buildIPv4UDPPacket(), and parseDHCPv4FromIPv4Frame() solved unaddressed-interface acquisition—until a subtle Linux socket semantic surfaced in the receive loop.

On Linux, passing Timeval{Sec: 0, Usec: 0} to SO_RCVTIMEO does not mean "return immediately"—it means disable the receive timeout and block forever! If a receive loop computes remaining budget rem := deadline.Sub(time.Now()) and 0 < rem < time.Microsecond, integer division truncates rem straight to {0, 0} and hangs the loop indefinitely:

rem := time.Until(deadline)
if rem < time.Microsecond {
    break // Never pass Timeval{0, 0} to SO_RCVTIMEO: Linux treats it as infinite wait
}
tv := syscall.NsecToTimeval(rem.Nanoseconds())
if err := syscall.SetsockoptTimeval(fd, syscall.SOL_SOCKET, syscall.SO_RCVTIMEO, &tv); err != nil {
    return lease, err
}

Trap 2: Boot-Once DHCP Without a T1/T2 Renewal Loop

Acquiring a DHCPv4 lease once during PID 1 initialization and discarding lease.LeaseTime is a ticking clock: hours later when the upstream CMTS lease expires, WAN silently vanishes. The satellite edge engine now runs a background RFC 2131 T1 (LeaseTime/2) / T2 renewal loop (RenewDHCPv4Lease) paired with staggered Gratuitous ARP broadcasts (+0s, +3s, +8s) so upstream switches and peers immediately refresh ARP caches after cold boots or link flaps.

Trap 3: VRRP Self-Blackhole Loops & netns-Gated Confirm

Consider a control host sitting behind a hosted edge VM where the edge owns the LAN gateway VIP. If a config edit or schema strip drops the edge health-check script (chk_edge_down_*), Keepalived sees no check, promotes the backup control host to MASTER, and stamps the LAN gateway VIP onto the host's own bridge—stealing the gateway IP while WAN is delegated to the edge and blackholing the entire LAN!

Two permanent safeguards now prevent that class of self-inflicted outage:

  • Daemon Self-Blackhole Guard: generateKeepalived inspects the hosted edge's active user-data (parseHostedEdgeEth1IPs); whenever any VRRP VIP matches the hosted edge's LAN IP, it automatically emits a liveness check—even if the declarative config omitted it—and HAEngine.OnTransition flushes stale bridge ARP entries for the VIP on FAULT/BACKUP instead of triggering false storage/identity demotions on single-node edge guards.
  • Synthetic netns LAN-Client Forwarding Probe (forwarding_probe.go): Config Confirm no longer trusts a blind 2-second sleep. Before confirming an apply, the daemon spins up an ephemeral isolated network namespace attached to the LAN bridge and verifies live ICMP, DNS, HTTP, and HTTPS forwarding through the gateway. If forwarding fails, Confirm rejects and triggers automatic rollback.

Trap 4: The Rosenpass failClosedBootGuard PostUp Time Bomb

Post-quantum WireGuard extensions (Rosenpass) often include a fail-closed boot guard that injects a random ephemeral preshared key at interface startup so peers cannot pass plaintext-PFS traffic before Rosenpass key exchange completes. The bug: when rosenpass.enabled was set alongside peers: [], the compiler fell back to emitting PostUp = sh -c 'head -c 32 /dev/urandom | base64 | wg set %i peer ... preshared-key /dev/stdin' for every peer on the WireGuard interface—including standard non-Rosenpass peers! Any service restart or reboot would silently overwrite every tunnel's PSK with random entropy. Scoping PostUp strictly to enabled rosenpass.peers matching the target interface eliminated the time bomb completely.

Trap 5: nftables ft_fastpath Swallowing Virtual & Overlay Interfaces

Linux nftables flowtables (flow add @ft_fastpath) accelerate established TCP/UDP forwarding—unless your iifname / oifname filter accidentally captures bridges, container CNIs, WireGuard, or Tailscale tunnels, bypassing policy hooks or breaking encapsulated paths. The compiler now explicitly excludes br-, vmbr, vxlan, cni, flannel, cilium, virbr, ovs, tap, veth, wg, and tailscale prefixes from ft_fastpath device lists, while satellite nftables rules pin flow add @fastpath strictly to { wanDev, lanDev }.

Trap 6: Unconfigured UPS Daemons, A/B ESP Slots & mTLS Edge Repair

Three smaller reliability guardrails rounded out the sweep:

  • nut.conf MODE=none Guard (service_ctl.go): nutIsConfigured() inspects /etc/nut/nut.conf so reloadOrRestartService cleanly stops/skips nut-client, nut-monitor, and nut-server on nodes without UPS hardware instead of failing config applies.
  • Dual-Slot EFI Staging (esp_slot.go) & mTLS Heal (subordinate_heal.go / subordinate_client.go): Added explicit EFI System Partition slot discovery and DIAGNOSE_EDGE / REPAIR_EDGE diagnostics over the mTLS control channel so the host can inspect live kernel interfaces and /proc/net/route on the zero-shell edge UKI without SSH.

3. Hardening 46 Security Audit Seams in the Paperclip Adapter & Plugin

Over in Eluvixrouter/eluvix (fac5a4c, +541 / -54 across 8 files), a comprehensive security hardening pass closed all 46 audit findings (H3–H5, M4–M6, L7–L10) across the Paperclip local adapter and auto-assignment plugin.

Security bugs in local AI-agent adapters are almost always trust-boundary illusions—assuming a config object is benign because it lives locally, or assuming .local means "my machine":

Dual-panel engineering diagram comparing six Linux edge failover traps on the left with 46 Paperclip adapter security seams and 11 upstream runtime PRs on the right

Here are the highest-leverage seams hardened in fac5a4c:

  • Dropping .local From Loopback (H3, H4, L8): validateLoopbackUrl and validateLoopbackEluvixUrl previously allowed eluvix.local. Because .local resolves via /etc/hosts, mDNS, or LAN DNS—not kernel loopback—a poisoned .local name could siphon Paperclip JWTs or elx_ API keys off the host. Both the adapter and plugin now strictly allow only 127.0.0.1, localhost, and ::1 across eluvixBaseUrl, PAPERCLIP_API_URL, and runtimeMcp.url.
  • Spawn Environment Scrubbing, cwd Confinement & Binary Allowlists (H5): Config-supplied environment variables can no longer override PATH, LD_PRELOAD, LD_LIBRARY_PATH, NODE_OPTIONS, DYLD_*, or OPENCODE_* (defense-in-depth at both execute.ts and spawnOpenCodeServer). Configured opencodeBinary values are checked against OPENCODE_BINARY_ALLOWLIST, and cwd is confined inside the adapter's resolved workspace root:
const DANGEROUS_CHILD_ENV_KEYS = ['PATH', 'LD_PRELOAD', 'LD_LIBRARY_PATH', 'NODE_OPTIONS'];

function sanitizeConfigEnv(envMap: Record<string, string | undefined>) {
  const out: Record<string, string | undefined> = {};
  for (const [k, v] of Object.entries(envMap)) {
    if (DANGEROUS_CHILD_ENV_KEYS.includes(k) || k.startsWith('DYLD_') || k.startsWith('OPENCODE_')) {
      continue;
    }
    out[k] = v;
  }
  return out;
}

function confineCwd(configuredCwd: string): string {
  const workspaceRoot = path.resolve(process.cwd());
  const resolved = path.resolve(configuredCwd);
  return resolved === workspaceRoot || resolved.startsWith(workspaceRoot + path.sep)
    ? resolved
    : workspaceRoot;
}
  • Company-Scoped Agent Verification & Rate Quotas (M4, M5): Auto-assign and approval flows now fetch ctx.agents.list({ companyId }) and reject any recommended agentId that does not belong to the target company, while proposals count toward maxPerHour.
  • Upfront Secret Resolution & Tool-Call Log Redaction (M6): resolveEluvixHmacSecret runs before pre-flight health checks so connection errors and tool_call JSON log lines are scrubbed by redactSecrets (including elx_* tokens with digits/underscores) just like assistant stdout.
  • file: Secret Caps & Handler Input Clamping (L7, L10): Secret file: references are restricted to regular files <= 4096 bytes inside allowlisted directories (blocking /dev/zero or arbitrary file reads), and plugin handlers enforce server-side bounds (MAX_TEXT_CHARS = 10_000, priority/sensitivity allowlists, finite numeric weights, and clamped topN).

4. Upstream Momentum: 11 Merged paperclipai/paperclip PRs & Live Cluster Studios

While hardening the adapter downstream, 11 pull requests landed upstream in paperclipai/paperclip, clustering into three clean runtime-reliability themes:

PatternMerged PRsEngineering Fix
Cancellation & Recovery Fidelity#22506, #15922, #15923Never restart a cancelled cursor-local run as a fresh session; stamp explicit attribution on cancel_continuations cancellations; stop capping new runs at the legacy disposition-repair allowance.
Config, Auth & Proxy Plumbing#22595, #18116, #22501Merge issue-level adapter override env per key instead of clobbering the whole map; preserve existing grant scopes when re-ensuring without one; handle client socket errors cleanly inside the sandbox allowlist proxy.
Quotas, Pagination & Docs Honesty#18110, #15671, #15669, #16533, #15936Match hyphenated 5-hour provider quota wording in claude-local; parse retry timestamps from codex-local usage limits; honor offset when listing company heartbeat runs; warn in the CLI when run list hits the server page cap; document the enforced 1800s timeoutSec default.

Meanwhile, two sibling ecosystem milestones clicked into place:

  • DeployCoop/vigilant-octo-waffle (PR #161 merged, +1,704 / -33 across 17 files, merge 6eba5d0): The Sloth-SLOs-as-code + Grafana Tempo PR that yesterday's post covered as open is now on main with CI all green — four PrometheusServiceLevel CRs (five SLOs, 30-day windows), a live Prometheus API client feeding real burn rates into the SLO studio, and Tempo 3.2.1 wired to the OpenTelemetry collector with a Grafana datasource.
  • DeployCoop/vigilant-octo-waffle (PR #162 merged, +8,774 / -827): Landed the final six Kubernetes operator studios (Mesh, DR, Postmortem, KEDA, Wasm, and Rewind) wired to real cluster CRDs, x509 certificates, Velero backups, and ArgoCD history—completing live telemetry parity across the control plane.
  • CrewsAIdarr/CrewsAIdarr (PR #9 opened, +316 / -1): Followed up Phase 2's local-first SQLite FTS memory bridge with Phase 3 documentation, configuration schemas, and operator runbooks for the Eluvix MCP consumer.

5. Graphics Craft Break: 154 Painted Storybook Assets & Post-Resize Magenta Despill

To keep the systems brain sharp, one parallel track pushed a 2D Godot tower-defense graphics pipeline from placeholder shapes to 154 hand-painted Arthur Rackham-inspired pen-and-ink and watercolor assets—coordinated across 5 parallel painter subagents with disjoint file ownership (Battlefield, Combat VFX, Storybook UI, Atlas & Title, and Ambient & Weather) and verified across 40/40 headless Godot test scenes (passed=40, fails=0) plus Xvfb opengl3 captures.

Editorial illustration contrasting magenta-fringed isometric sprite-sheet tiles on the left transforming through a luminous prism into crisp halo-free pen-and-ink watercolor fantasy towers, forest puddles, and parchment maps on the right

The standout technical lesson from that pipeline applies to any automated sprite or UI asset slicer: the ordering trap between chroma-keying and downscaling.

When generating high-resolution sprite sheets on a #FF00FF magenta key background and resizing down to game tile dimensions:

  1. If you run chroma-key + edge despill first and resize second, bilinear or Lanczos filtering samples neighboring transparent pixels whose RGB channels may still carry residual magenta (R > G, B > G) and blends them right back into semi-transparent boundary pixels—creating an unmistakable neon-pink halo around every tower and UI seal.
  2. Moving the 3-pixel outer-edge magenta despill pass after resizing in the asset slicer strips residual magenta chroma strictly from the final exported alpha boundary, leaving clean pen-and-ink silhouettes against dark twilight maps and sunlit meadows alike.

Pair that with softening puddle boundaries in shaders/terrain_bake.gdshader into layered watercolor washes, and every visual subsystem cleared automated inspection without sacrificing framerate or Android APK readiness.


The Takeaway: Five Rules for Transition-Safe Systems

  1. Split metadata trust from payload weight: A < 200 KiB GPG-signed APT index on static hosting plus 302 CDN redirects gives you full cryptographic verification with zero origin servers to patch.
  2. Respect kernel edge-case semantics: SO_RCVTIMEO {0, 0} means "block forever," protojson fallback needs req.Reset(), and ssh-keygen needs an explicit ExecStartPre ordering barrier.
  3. Gate failover and confirmation on live end-to-end probes: Auto-guard VRRP VIPs against self-blackholing and verify real forwarding inside an isolated netns before confirming network config changes.
  4. Never trust .local or un-scrubbed child env: Lock local IPC strictly to numeric/loopback hosts, strip LD_PRELOAD/PATH/NODE_OPTIONS at spawn boundaries, and redact secrets before the very first network call.
  5. Despill after downscaling: Whether it's sprites or telemetry, transformations near boundaries always re-expose edge artifacts—clean the boundary at the final output resolution.

Discussion / Comments

Click “Load Comments” to load the Disqus conversation thread.