rollback-revision
Skill2 starsChanged 2 months agoMITView on GitHub
Roll back by moving one or more Unit heads to bound prior revisions via cub unit update --restore, then hand off to release-publish. Use for "roll back this change", "revert the last release", "undo the ChangeSet", or "restore to the last applied revision". Not for a clearer one-field forward fix.
In this repository15 other files it gives its agents.
- app-configSkill
- confighub-coreSkill
- cub-applySkill
- cub-mutateSkill
- cub-querySkill
- importSkill
- incident-managementSkill
- kubernetes-resourcesSkill
- promote-releaseSkill
- release-publishSkill
- skill-examples-bootstrapSkill
- target-bindSkill
- triggers-and-applygatesSkill
- verify-applySkill
- worker-bootstrapSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 55
Treat relative and LastReleasedRevisionNum forms only as resolution aids: read what each resolves to and bind the exact RevisionNum, …
- Very specific: line 92
After a successful restore, hand fresh state to release-publish.
- Distinctive: line 101
After verifying the Tag, attach it in a separate call:
- Very specific: line 129
After verifying the restored heads, hand fresh state to release-publish for complete EffectiveReleaseSet disclosure and a separate …
- Very specific: line 136
If changes were made to the affected Units *after* the ChangeSet that you want to keep (e.g., urgent hotfixes applied after the bad …
- Distinctive: line 160
Not allowed: historical runtime replay as a rollback, manually matching old data, or rolling back across applications in one scope.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
rollback-revision
Execution mode: follow references/execution-modes.md. This Skill grants no automatic tool permission. After binding and diffing the exact restore target, standalone use submits one requested head-moving restore to the host permission system. The later whole-Space publication is a separate host-permission call; an external overlay may stop either step before Bash.
Resolve and preview the exact Unit head or ChangeSet scope to restore. On a clear standalone rollback request, submit one exact restore through the host permission system, verify it, and treat the later whole-Space publication as a separate request.
cub unit update --restore is the only rollback mechanism
Rollback always means: create a new head whose data equals a bound prior Revision, then publish that restored desired state through a newly approved Space Release. Every subsequent mutation branches from the restored head, so the bad state stays gone.
Rollback is a head-moving cub unit update --restore followed, after verification, by a separate immutable Space Release. Each is its own host-permission call. Do not try to replay historical runtime data without moving head: the next mutation or promotion would re-introduce the bad state.
Recognize and refuse the retired-unit-runtime-verbs anti-pattern retained in
compatibility/no-loss-inventory.v1.json; the active skill deliberately does
not reproduce its executable spelling. That historical bridge-era form could
deploy old bytes without moving head, so it is not rollback. The current
OCI Release profile has no per-Unit apply fallback. The durable route is to resolve the
requested prior revision to RevisionID/DataHash, create a new head with
cub unit update --restore 47, and then prepare a fresh Space Release.
When to use
- User says "roll back", "revert", "undo" — and means it: the restored state should be the new baseline.
- Post-promotion rollback: a ChangeSet went out, the destination env rejects it, restore every affected Unit to
Before:ChangeSet:<slug>. - Single-Unit revert: one Unit got a bad revision, restore to
LastReleasedRevisionNumor a specific prior number.
Do not load for
- Fixing a single wrong field when the forward mutation is obviously cleaner (a
cub-mutaterun withset-container-imageback to the old tag). Restore is heavier than a one-line change. - Reversing a change that has not been captured by publication and has not been proven at runtime — use a forward
cub-mutateor restore to the revision before the bad one; do not claim anything about what is live from Unit metadata alone.
Preflight gates
cub auth statussucceeds — it contacts the server's/meendpoint to confirm the token is still valid (not just local login state). If it fails, ask the user to runcub auth login(an interactive browser sign-in an agent cannot complete). User has write permission on the target Space(s).- The rollback scope is explicit: single Unit slug, or a Filter (usually the
<app>-home/<app>-appFilter from the promotion that's being rolled back) + optional--wherenarrowing. - The rollback target is explicit. Installed
--restoreselectors include:- Absolute revision number (
--restore 42). Note--restore 1restores empty: every Unit now begins with an empty start revision and its created content lands on Revision 2. Units created before that change kept content on Revision 1, so readcub revision listrather than assuming which meaning applies. - Relative (
--restore -1= one before head). LastReleasedRevisionNum— the Revision most recently captured by ConfigHub publication bookkeeping; not proof of controller consumption or current runtime state. This is the formerLastAppliedRevisionNum; the bridge-eraLiveRevisionNumandPreviousLiveRevisionNumselectors no longer exist.Tag:<home-space>/<tag>— a named release marker.ChangeSet:<home-space>/<slug>— the end of a ChangeSet.Before:ChangeSet:<home-space>/<slug>— the ChangeSet's start tag, i.e. the head each Unit had immediately before the ChangeSet opened (the standard "undo release X" target). The start tag marks a revision that already existed rather than one manufactured by attaching, so a Unit that joined the ChangeSet and never changed rewinds cleanly along with the rest.- A revision UUID.
Treat relative and
LastReleasedRevisionNumforms only as resolution aids: read what each resolves to and bind the exact RevisionNum, RevisionID, and DataHash before approval.
- Absolute revision number (
- The destination currently isn't in the middle of another open ChangeSet on the same Units.
- User has confirmed the exact resolved revisions and understands that the later Release may include additional Units.
Pick the right target
# Inspect history to pick a target.
cub revision list <unit> --space <space>
# For a bulk rollback scoped to a ChangeSet, list the ChangeSet's revisions:
cub revision list --space <space> --filter <app>-home/<app>-app \
--where "ChangeSet.Slug = '<changeset-slug>'"Named targets (Tag: / Before:ChangeSet:) are useful resolution aids, but Tags and ChangeSet metadata are not immutable approval subjects. Resolve any selector now and bind the exact RevisionNum, RevisionID, and DataHash before review; re-resolve before any authorized execution.
The last source-reviewed v0.2.11 Unit update path could transactionally compare
caller-supplied HeadRevisionNum and DataHash. That older
finding is not projected onto the installed v0.2.21 server. The stock v0.2.15
restore command does not expose those expected current-state fields. Re-read
immediately before the call, name the race, and do not claim exact
preview-to-execution binding.
Shape A — single-Unit rollback
cub unit update --space <space> <unit> \
--restore <target> \
--change-desc 'Rollback Unit to reviewed revision'Then verify separately:
cub unit diff <unit> --space <space>After a successful restore, hand fresh state to release-publish. A single-Unit restore does not imply a single-Unit Release; release-publish must show the complete EffectiveReleaseSet and obtain a separate host permission for publication.
Optionally tag the new head for future reference:
cub tag create --space <home-space> rollback-<YYYYMMDD>-<unit> \
--annotation 'description=Record reviewed Unit rollback'After verifying the Tag, attach it in a separate call:
cub unit tag <home-space>/rollback-<YYYYMMDD>-<unit> --space <space> --unit <unit>Shape B — ChangeSet rollback (standard post-promotion revert)
This is the standard "undo a release" path, and it's one command per step thanks to the ChangeSet.
A promotion is nearly always Shape B, not Shape A. An upgrade or cub variant promote walks its range and records one downstream revision per upstream revision that had an effect — so a single promotion produces many revisions per Unit, and different Units get different numbers of them. There is no revision number that means "just before the promotion" across the set, and --restore -1 rewinds one hop of the walk rather than the promotion. If the promotion was wrapped in a ChangeSet, Before:ChangeSet: is the set-wise rollback target. If it was not, there is no set-wise undo: say so plainly, and reconstruct per Unit from cub revision list — the last revision before the first one carrying the promotion's change descriptions.
Resolve the placeholders to literal values. Submit and verify the Tag first:
cub tag create --space <app>-home rollback-<changeset-slug> --annotation 'description=Record reviewed ChangeSet rollback'Then submit the restore as one separate call:
cub unit update --patch --space <app>-<environment> \
--filter <app>-home/<app>-app \
--restore 'Before:ChangeSet:<app>-home/<changeset-slug>' \
--tag <app>-home/rollback-<changeset-slug> \
--change-desc 'Rollback reviewed ChangeSet for incident'After verifying the restored heads, hand fresh state to release-publish for
complete EffectiveReleaseSet disclosure and a separate publication decision.
Each Unit head reverts to its pre-ChangeSet data. If the rollback needs approval, cub variant approve resolves its selector at execution and has no expected RevisionID/DataHash precondition, so compare the revisions its response covers with the restored heads that were reviewed. Neither approval nor the restore publishes anything. The rollback Tag remains a retrieval marker.
Shape C — rollback then reapply held-back changes (merge / rebase)
If changes were made to the affected Units after the ChangeSet that you want to keep (e.g., urgent hotfixes applied after the bad release), a plain restore discards them. Use a 3-way merge instead (per references/changesets.md):
cub unit update --patch --space <app>-<environment> \
--filter <app>-home/<app>-app \
--merge-source Self \
--merge-base 'Before:ChangeSet:<app>-home/<changeset-slug>' \
--merge-end 'ChangeSet:<app>-home/<changeset-slug>' \
--change-desc 'Merge reviewed changes onto rollback head'This is an advanced path. Only reach for it when you've verified the hotfixes actually need preserving.
Verify chain
cub unit get <unit> --space <space> -o yaml— Data matches the target revision's data.cub revision list <unit> --space <space>— the new head revision has the rollback--change-desc(and Tag, for Shape B).release-publishcaptures the restored heads in an exact new Space Release;verify-applybinds its ManifestDigest to controller/runtime proof. Legacy BridgeState/LiveRevision is not cluster proof for OCI delivery.- For Shape B:
cub revision list --space <app>-<environment> --filter <app>-home/<app>-app --tag <app>-home/rollback-<changeset-slug>lists one restored revision per intended Unit.
Tool boundary
- Host permission: read-only Unit/revision/ChangeSet inspection; the pack preapproves no Bash call.
- Standalone mutation steps:
cub unit update --restore, tags,cub variant approve, and the new Release are separate one-command host-permission calls. The restore has the pre-read race described above;release-publishowns exact publication scope. - Not allowed: historical runtime replay as a rollback, manually matching old data, or rolling back across applications in one scope.
Stop conditions
- The ChangeSet being rolled back is still open. Stop. Close it first (
cub unit update --patch --filter <f> --changeset -) — you can't restore across an open ChangeSet without violating the lock. - Scope includes Units from multiple apps'
<app>-homes. Split the rollback per app; one rollback per app. - User wants to delete the rolled-back revisions from history. Not possible, and not desirable — restore creates a new head; the "bad" revisions stay in the audit trail.
- Rollback target is the Unit's current head (no-op). Tell the user and stop.
- The promotion being rolled back was not wrapped in a ChangeSet. There is no set-wise restore target; confirm the per-Unit targets with the user before submitting a reconstructed scope.
- The restore would rewind past protection or conflict state the user has not seen. Restore rewinds
MutationSources— including each path'sProtectedflag — along withData, so a restore also restores which paths the variant owned at that point. Readcub unit get <unit> -o mutationsbefore and name the difference.
Evidence
cub space open <space> --print-url— restored Space.cub unit open <unit> --space <space> --revisions --print-url— restored head history.
References
references/changesets.md—Before:ChangeSet:<slug>target, bulk restore pattern, 3-way merge for held-back changes.references/revisions.md— current restore-target syntax (Tag:,ChangeSet:, relative / absolute numbers, UUIDs), the empty start revision, and how restore rewindsMutationSourceswithData.references/filters-and-queries.md— scoping the rollback via Filter.references/cub-cli.md—--change-descscope,-sentinel for--changesetclose.- Companion skills:
release-publish(post-restore whole-Space Release),cub-mutate(forward fix when clearer),promote-release(the forward counterpart),verify-apply(post-rollback checks).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

