Rollback Dry Run turns a story's deployment steps into a reviewable destructive changes preview file. The metadata undo plan to Data Vault's data recovery.
Preview only, always. Built for the Agentia Headless Virtual Hackathon
as an oclif plugin on top of the public agentia CLI.
- The Problem
- Features
- Installation
- Quick Start
- Live Demo Workflow
- Command Reference
- Configuration
- Troubleshooting
- How It Works
- Security
- Tech Stack
- Architecture
- Hackathon Fit
- License
Undoing a Salesforce deployment means hand writing the destructive changes file from the deployment payload. Mapping every member to its type by hand is slow and error prone, and mistakes surface only in production when the undo itself fails.
- Step reading — deployment steps through the verified list command scoped by user story.
- Flexible mapping — understands typed objects, dotted
Type.Namestrings and solo type plus name fields. - Honest unmapped reporting — anything unrecognized is listed for manual review instead of silently dropped.
- Offline fixture mode —
--steps-fileaccepts a JSON step array with zero CLI calls. - Valid XML output — escaped members grouped by type with a stamped API version.
- Pre-flight simulation —
rollback simulatechecks every member against the target org index and scores confidence honestly before you write the plan. - Zero private imports — only shells out to public
agentiacommands.
- Node 18 or newer.
- Agentia CLI beta:
npm install -g @copado/agentia-cli@beta - Authenticated machine:
agentia setup(CICD at minimum).
git clone https://github.com/devkdas/agentia-rollback-dryrun.git
cd agentia-rollback-dryrun
npm install
npm run build
agentia plugins link .Re-run npm run build after every change to the TypeScript files.
agentia rollback generate --story US-0000024agentia rollback generate --steps-file steps.json --out ./rollback.xml --jsonagentia rollback simulate --story US-0000024 --source-credential-id a11hm0000016pTxAAI --source-org-id 00Dhm000004sqH4EAI --jsonVerified live:
1. agentia rollback generate --story US-0000024 --json
-> 0 steps on this story, valid empty file plus honest note
2. Fixture with ApexClass, ApexTrigger and one mystery step
-> 2 members across 2 types mapped, mystery listed unmapped
3. Generated XML with escaped members grouped by type, version stamped
4. agentia rollback simulate --steps-file steps.json --source-credential-id ... --source-org-id ... --json
-> honesty graded confidence, missing members listed before planning
| Flag | Description |
|---|---|
-s, --story <id> |
User story owning the deployment steps |
--steps-file <path> |
JSON step array for offline use |
-o, --out <path> |
Output file (default ./rollback.xml) |
--api-version <v> |
Stamped version (default 61.0) |
-j, --json |
Machine readable JSON summary |
One of --story or --steps-file is required. The command never
deploys or deletes anything.
| Flag | Description |
|---|---|
-s, --story <id> |
User story owning the deployment steps |
--steps-file <path> |
JSON step array for offline use |
--source-credential-id <id> |
(required) Target org credential ID for member checks |
--source-org-id <id> |
(required) Target org ID for member checks |
--pipeline-id <id> |
Pipeline ID scoping gateway calls |
-j, --json |
Machine readable JSON summary |
Scores confidence honestly: resolvable members raise it, missing
members lower it and are listed by name. One of --story or
--steps-file is required. Read only against the org index, never
a deployment.
Output path plus API version only. Review the file before any real rollback since unmapped entries need human judgment.
| Problem | Likely cause | Fix |
|---|---|---|
| Empty member list | Story has no deployment steps yet | Add steps in the story first |
| Unmapped entries | Exotic step shapes | Map them by hand into the file |
| ESM auto-transpile warning | Linked ESM plugin notice | Benign, compiled output is used |
agentia rollback generate
-> deployment-step list --user-story (or fixture file)
-> flexible member mapping with honest misses
-> destructiveChanges XML grouped by type
agentia rollback simulate
-> same step reading as generate
-> member check against target org index
-> honesty graded confidence plus missing list
Pure preview. No org writes, no deletions, no tokens. The file is a plan for humans to review, never an auto executed undo.
| Layer | Technology |
|---|---|
| Language | TypeScript on Node 18+ |
| CLI Framework | oclif v4 (ESM, matching the host CLI) |
| Runtime calls | node:child_process to public agentia commands |
Developer / Agent
|
agentia rollback generate --story
|
Rollback Dry Run (this plugin)
|- reader -> deployment-step list
|- mapper -> typed, dotted and solo shapes
|- writer -> escaped XML grouped by type
|- checker -> org index member check plus confidence
|
Preview file plus JSON summary, simulate first for confidence
Prototypes the missing undo capability with a safe preview, improves reliability for every team that fears production rollbacks, and pairs with Data Vault to cover metadata plus data recovery together.
MIT License — see LICENSE for details.