Skip to content

feat: bundle rollout PR-β.2 — GC + release-lockfile invariant - #34

Merged
phramz merged 1 commit into
mainfrom
feat/bundle-rollout-pr-beta-2
Apr 21, 2026
Merged

feat: bundle rollout PR-β.2 — GC + release-lockfile invariant#34
phramz merged 1 commit into
mainfrom
feat/bundle-rollout-pr-beta-2

Conversation

@phramz

Copy link
Copy Markdown
Contributor

Summary

Closes Tβ-7 and Tβ-8 of docs/superpowers/specs/2026-04-20-bundle-schema-and-rollout-design.md. Reliability foundation for the rollout design.

  • cmd/gc-bundles — new Go tool that enumerates referenced digests across every remote branch + every published release tag, lists GHCR versions for php-core + php-ext-* packages, and emits candidates for prune (old + unreferenced). Dry-run default; real delete guarded behind workflow_dispatchconfirm: true. Unit-tested against a bare-repo fixture (ref enumeration) and an injectable Runner (GHCR operations).
  • gc-bundles.yml — replaces the stub with a real invocation. Quarterly schedule. Uploads a gc-bundles-report artifact (90-day retention) every run so maintainers can review candidates before the next real-delete cycle.
  • test/invariants/release_lockfile_test.go//go:build invariants test that HEADs every digest in every published release's bundles.lock against GHCR. Uses the correct OCI manifest Accept header and anonymous pull-token flow (lesson from PR-β.1's Accept-header debugging). Proves product-vision §16 reproducibility: pinned @vX.Y.Z references must remain resolvable.
  • release-please.yml + nightly.yml — new invariant-check wiring. On release-please, gated on release_created. On nightly, if: always() as a drift guard.
  • .golangci.yml — extends the gosec G204 exclude-rule to cmd/gc-bundles/ (same justification as cmd/lockfile-update/: internal subprocess invocation with internally-constructed args).
  • Makefilegc-bundles-dry-run convenience target.

Test plan

  • go test -race ./cmd/gc-bundles/ — 3 unit tests green (refs enumeration, GHCR list, filter)
  • go test -tags invariants ./test/invariants/... — passes locally against existing releases
  • make check — clean
  • First quarterly gc-bundles.yml schedule emits a sensible report — inspect the artifact; don't flip confirm: true until reviewed
  • Next release-please run completes invariant-check green

Operational notes

The first gc-bundles dispatch should run WITHOUT confirm: true so we can review what it plans to delete. Only after that review should we run with confirm: true manually. The quarterly cron stays dry-run-only — real deletes require explicit manual dispatch. Report artifact has 90-day retention for audit.

No runtime changes in this PR.

Closes Tβ-7 and Tβ-8 of the bundle-schema-and-rollout spec. Reliability
foundation for the rollout design: orphan bundles from declined PRs reap
themselves on a bounded schedule; releases never silently lose their
reproducibility guarantee.
- cmd/gc-bundles: new Go tool that unions bundles.lock digest references
across every remote branch + every published release tag, lists GHCR
versions for php-core and php-ext-* via gh api, and filters by age +
unreferenced-ness. Dry-run default; real delete behind a
workflow_dispatch confirm input. Tested against a bare-repo fixture
(refs enumeration) and an injectable Runner (GHCR operations).
- .github/workflows/gc-bundles.yml: replaces the stub with a real
invocation; uploads the dry-run report as an artifact (90-day
retention) for review before flipping confirm on the next dispatch.
- test/invariants/release_lockfile_test.go: //go:build invariants test
that HEADs every released lockfile's digest on GHCR with the correct
OCI manifest Accept header and anonymous pull-token flow (lesson
from PR-β.1 debugging). Proves product-vision §16 reproducibility.
- release-please.yml + nightly.yml: new invariant-check that runs the
test after every release (gated on release_created) and nightly as a
drift guard (if: always()).
- .golangci.yml: extends the gosec G204 exclude-rule to cover
cmd/gc-bundles/ — internal subprocess invocation, same pattern as
cmd/lockfile-update/.
- Makefile: gc-bundles-dry-run convenience target for local verification.
No runtime changes — this PR is pure reliability-side hardening.
@phramz
phramz merged commit c212a86 into mainApr 21, 2026
37 checks passed
@phramz
phramz deleted the feat/bundle-rollout-pr-beta-2 branch April 21, 2026 11:18
Sign up for freeto 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

@phramz