Retain wiki rollback images and expire unused CI images #17
Reference in New Issue
Block a user
Delete Branch "codex/wiki-image-retention"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Wiki CI leaves a runtime image and an integration image for every revision, so replacing the running containers does not stop historical images accumulating.
This change adds a wiki-only lifecycle entrypoint that locks the complete build/integration/deploy/cleanup sequence. Verified deployments atomically record a success ledger; cleanup keeps the current release, two previous successful releases, their operational test images, every container-referenced image, and a 72-hour debug window. Until three successes have been recorded, historical runtime images remain protected. The matching test images must stay because existing Studio verification/publishing scripts use them as tools.
The cleanup CLI defaults to preview and prints keep/delete reasons. Apply rechecks references and never uses forced removal, global prune, or volume deletion. New build-stage labels allow later expiry of owned failed build containers only when exited, at least 72 hours old, and without mounts. Legacy prompt:* images, foreign tags/digests, unlabelled old intermediates, persistent data and backups are excluded. Cleanup errors preserve the original CI result.
Validation on the user-confirmed ces-control host:
A dedicated PR workflow runs only Python policy tests and shell syntax checks on ces-control. Full Docker build, integration and deployment remain main-push-only and have not run for this change; they execute after the user manually merges. Existing old workflow jobs/raw Docker commands do not acquire the new lock, so let old wiki jobs finish before the first apply. This PR does not enable a timer or clean the legacy prompt images.
Base: main. Head: codex/wiki-image-retention. Waiting for user manual merge; no auto-merge or deployment performed.