Skip to content

fix(kit): aur builder fails loudly on zero produced packages (R8) - #4

Merged
atrawog merged 2 commits into
mainfrom
feat/aur-builder-empty-guard
Jul 8, 2026
Merged

atrawog merged 2 commits into
mainfrom
feat/aur-builder-empty-guard

Conversation

@atrawog

@atrawog atrawog commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

The aur builder stage ended with find /tmp/aur-build -name '*.pkg.tar.zst' -exec cp {} /tmp/aur-pkgs/ \; — which silently succeeds on zero matches. When a package listed under a candy's aur: block has moved from the AUR into a repo, yay -S --needed installs it from the repo without building, zero .pkg.tar.zst are produced, and an empty /tmp/aur-pkgs COPY layer gets committed and cached — the masked failure behind the pgvector / check-cachyos-immich-ml-pod "could not find or read package" build failure (fixed separately by moving pgvector to package:). Added a guard after the copy: a non-empty package list that produced no artifact now exit 1s with a message pointing at the fix.

Change class + gate

sdk (kit) library. go build ./... && go test ./... green; TestAurStage_EmptyOutputGuard asserts the rendered stage carries ls /tmp/aur-pkgs/*.pkg.tar.zst … exit 1 after the find|cp. Guard shell logic proven: exit 1 on an empty dir, exit 0 when an artifact is present. The behavioral gate (a real arch aur build with a genuine AUR package — arch-test/yay-bin — that the guard must NOT break) rides the superproject consumer PR that bumps this pointer, per the SDK-first landing order.

Tier: fully tested and validated.

Assisted-by: Claude (fully tested and validated)

The aur stage's `find … -exec cp` silently succeeds on zero matches, so a package
that moved from the AUR into a repo (yay -S --needed installs it without building)
produced an EMPTY /tmp/aur-pkgs copy layer that was committed + cached — the
masked failure behind the pgvector / check-cachyos-immich-ml-pod build failure.
Add a guard: a non-empty aur: package list producing zero .pkg.tar.zst now exit
1s with a fix hint. Verified: rendering test asserts the guard follows the copy;
shell logic exits 1 on empty dir, 0 with an artifact. Behavioral arch-test build
rides the superproject consumer PR.

Assisted-by: Claude (fully tested and validated)
@atrawog

atrawog commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: code/config (sdk kit/ library — Go)

Item Verdict
Security & anti-tampering (T1–T4) PASS — additive shell guard + test + changelog; no secrets/exfiltration, no new deps, no weakened gate (it strengthens the aur builder by failing loudly), scope matches the description exactly, no attempt to manipulate the validator
1. Description complete PASS — Summary · change-class + gate · tier
2. Change-class gate vs evidence PASS — sdk is a library repo with no bed; go build ./... + go test ./... green, TestAurStage_EmptyOutputGuard PASS, guard shell-logic independently proven (empty dir → exit 1, artifact present → exit 0); the behavioral arch-build gate legitimately rides the superproject consumer PR (SDK-first landing)
3. Attribution tier justified PASS — fully tested and validated matches repo convention for equivalent additive sdk-level changes (2026.189.0059 / .0026); both changed code paths executed live with pasted proof
4. R5 grep self-test N/A — purely additive; no identifier removed or renamed
5. R1–R4 / clean architecture PASS — additive guard; no duplication / workaround / dead path
6. CHANGELOG present PASS — CHANGELOG/2026.189.0245.md (placeholder; finalized to the merge-time CalVer at merge)
7. Skills honored PASS — /charly-internals:plugin (the BuilderResolve render contract) + /charly-image:layer (the aur builder)

Non-blocking note (pre-existing, out of scope): gofmt -l . flags 5 generated spec/*.go wire files (deploy / init / k8sgen / mcp_provides_test / vm) — these are DIRTY on origin/main already (gengotypes column-alignment drift), untouched by this PR (which only adds to kit/). This PR's own files are gofmt-clean. That is a separate pre-existing cutover, not a blocker for this guard.

Decision: The diff appends { ls /tmp/aur-pkgs/*.pkg.tar.zst >/dev/null 2>&1 || { echo …; exit 1; }; } after the find … -exec cp {} /tmp/aur-pkgs/ \; (joined by && \) in aurStageTemplate — verified byte-for-byte in the const. It fails loudly only when a non-empty aur: package list produces zero .pkg.tar.zst artifacts (the masked pgvector / check-cachyos-immich-ml-pod failure), and the copy runs first so the guard checks the copy's result. Additive; no other template or behavior change. Unit-tested + shell-logic proven independently. APPROVED.

Assisted-by: Claude (fully tested and validated)

…-output guard)

Assisted-by: Claude (fully tested and validated)
@atrawog
atrawog merged commit 6c20071 into main Jul 8, 2026
@atrawog
atrawog deleted the feat/aur-builder-empty-guard branch July 8, 2026 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant