case study
A plan, verify and rollback method for releases
My role: I built this in 2026 as a demonstration of a release method. It runs on sample folders, uses no client or employer material, and the source is public.
Scope and constraints
- Ownership
- A solo demonstration with a sample cafe site. Not client or employer work.
- Scale
- One script, a sample build and target, and a test suite.
- Constraints
- A person must see what will change before it changes, a reviewed plan must not drift, and every uploaded file must be checked.
- Judgment calls
- Plan before write, bind the review to the apply, verify everything, and keep the target’s own files out of the upload set.
What was delivered and checked
- Tests cover the five file statuses, plan id stability and sensitivity, refusal of a stale plan, refusal when the target changed, the deny-list, backups, verification, tamper detection, rollback and its refusal, noise-only files, the ledger and manifest mode.
- A sample failure register is read by a test that fails if a named guard is missing.
What it is
A way to release a folder of files to a target folder without overwriting someone else's work or guessing whether the copy worked. It is one script with plan, apply, verify, rollback and log commands, a sample build and target, and tests.
The path of one release
- PlanRead-only. Compares the build with the target and marks each file new, changed, identical, denied or noise-only.
- ReviewA person reads every real difference before anything is written.
- ApplyRefuses unless the plan it recomputes has the id that was reviewed. Backs up every file it overwrites.
- VerifyRe-reads every uploaded file and compares its checksum with the build.
- RollbackRestores the backups, and refuses if a file changed after the apply.
$ plan build target
- menu.html+new
- index.html~changed
- about.html=identical
- site.configxdenied
- styles.css#noise-only
plan id a3f9c1
2 real differences to review. A person reads them before apply.
$ apply a3f9c1
recomputed plan id 7be204
refused: recomputed id 7be204 differs from reviewed id a3f9c1. Nothing was written.
The ledger
Each apply and rollback adds one line. The tool never rewrites it.
- 0001applyplan a3f9c12 files written, 1 backup kept
- 0002applyplan 5d20e83 files written, 2 backups kept
- 0003rollbackplan 5d20e82 files restored from backups
- 0004next line is added here
Lines are only added at the end; the tool never rewrites an earlier one.
Decisions
A read-only plan comes first
Nothing is written until the plan shows what would change, so work already on the target is not overwritten by surprise. The cost is an extra step and a comparison of every candidate file.
The plan id binds the review to the apply
Apply recomputes the plan and refuses if its id differs from the reviewed one, so a reviewed plan cannot drift. The cost is that anything that changes the build or the target between plan and apply needs a new review.
Verify every uploaded file, not a sample
A sample can pass while one file is wrong. Every uploaded file is read back and compared. The cost is more reading after each apply.
A deny-list that is never uploaded
Files that belong to the target, such as its own configuration, can never be in the upload set, and apply refuses if one appears. The cost is that a deliberate change to those files has to be made another way.
Noise is separated from change
Lines that differ on every rebuild, such as build stamps, are matched by pattern and a file that differs only by them is not uploaded. The cost is that the patterns have to be kept honest, and they are compared after removal so a noisy line cannot hide a real edit next to it.
An append-only ledger
Each apply and rollback adds one line. The tool never rewrites it.
Scope
Sample folders as the target
The target is a local folder, so the method runs end to end on a sample build and target.
Verification is byte for byte
Verification compares every uploaded file with the build byte for byte.
Source and tests
The source, the sample data and the tests are in the release-plan repository, under the MIT licence. npm test runs the tests.
Stack
- Node.js
- JavaScript
- Node test runner