Before a one-page release replaces the rest of a site
You change a homepage, review it carefully and publish the folder beside it. The homepage is correct. An About edit made yesterday disappears, and a note published this morning becomes a missing page. The release contained the intended change and an unnoticed older copy of everything around it.
The useful review question is larger than “does the new page look right?” Ask which existing files the complete release will replace. This article works through that question with fictional file contents and a small, executable comparison. It does not perform a deployment.
Write down the boundary before comparing files
For this example, the intended release changes index.html and adds assets/ui-b.js. It keeps the earlier script, the current About page, the notes index and an existing note. Those decisions are explicit; a filename containing a hash does not make an addition automatically authorised.
A manifest here means a collection of relative file paths and SHA-256 digests. Use the same path convention and input representation for every snapshot. The fictional experiment hashes UTF-8 strings. A real file inventory should digest the actual file buffers, including binary assets, rather than converting everything into text first.
The Node.js Hash documentation provides the digest API used below. The comparison assigns a label to a changed path; the digest does not know why the path changed or whether the new content is preferable.
| Fictional path | Current published contents | Stale candidate | Intended treatment |
|---|---|---|---|
index.html | Home v1 | Home v2 | Change deliberately |
about/index.html | About v2 | About v1 | Preserve v2 |
notes/index.html | Notes v2 | Notes v1 | Preserve v2 |
notes/new/index.html | New note | Missing | Preserve the note |
assets/ui-a.js | Script A | Script A | Keep unchanged |
The table makes two failure types visible. An older page still exists and may return a perfectly normal response. A missing note is a removal. Checking only the homepage cannot distinguish either from a successful release.
Keep three snapshots separate
The baseline is the published version captured when the review began. The current snapshot is what is published immediately before the proposed replacement. The candidate is the complete output intended for that replacement.
Comparing baseline with current answers whether the review started from a version that is still current. Comparing current with candidate answers what the proposed release would actually change. Neither comparison substitutes for the other.
This also separates review from coordination. An unchanged current snapshot is useful evidence at the instant it was captured. It does not stop another person publishing a change one second later. A release process needs its own coordination mechanism if concurrent writers are possible. The script deliberately contains no lock or deployment command.
Run the fictional comparison
The following is the complete local fixture. Save it as manifest-lab.mjs and run node manifest-lab.mjs. It requires no packages. All inputs are invented strings in memory: it reads no project directory, contacts no server, modifies no files and publishes nothing.
AI assistance was used to prepare the fixture, check its output and draft the explanation. The fixture was executed with Node.js 26.11.1 on November 10, 2026. These are local synthetic results, not observations of customer sites, a live deployment or a production incident.
// Fictional in-memory UTF-8 files. No filesystem, network or deployment writes.
import { createHash } from 'node:crypto';
import assert from 'node:assert/strict';
const manifest = (files) => Object.fromEntries(
[...files].sort(([a], [b]) => a.localeCompare(b)).map(
([path, text]) => [path,
createHash('sha256').update(text, 'utf8').digest('hex')]
)
);
function delta(before, after) {
const paths = [...new Set([
...Object.keys(before), ...Object.keys(after)
])].sort();
return paths.flatMap((path) => {
const kind = !(path in before) ? 'added'
: !(path in after) ? 'removed'
: before[path] !== after[path] ? 'changed' : null;
return kind ? [{ path, kind }] : [];
});
}
function review(baseline, current, candidate, allowed) {
const drift = delta(baseline, current);
const changes = delta(current, candidate);
const outside = changes.filter(({ path }) => !allowed.has(path));
return { pass: !drift.length && !outside.length,
drift, changes, outside };
}
const published = new Map([
['index.html', 'Home v1'],
['about/index.html', 'About v2'],
['notes/index.html', 'Notes v2'],
['notes/new/index.html', 'New note'],
['assets/ui-a.js', 'Script A']
]);
const stale = new Map([
['index.html', 'Home v2'],
['about/index.html', 'About v1'],
['notes/index.html', 'Notes v1'],
['assets/ui-a.js', 'Script A']
]);
const reconciled = new Map([
...published,
['index.html', 'Home v2'],
['assets/ui-b.js', 'Script B']
]);
const later = new Map([
...published,
['about/index.html', 'About v3'],
['notes/later/index.html', 'Later note']
]);
const allowed = new Set(['index.html', 'assets/ui-b.js']);
const base = manifest(published);
const cases = {
stale: review(base, base, manifest(stale), allowed),
reconciled: review(base, base, manifest(reconciled), allowed),
drifted: review(base, manifest(later),
manifest(reconciled), allowed)
};
assert.equal(cases.stale.pass, false);
assert.equal(cases.stale.changes.length, 4);
assert.equal(cases.stale.outside.length, 3);
assert.equal(cases.reconciled.pass, true);
assert.equal(cases.reconciled.changes.length, 2);
assert.equal(cases.drifted.pass, false);
assert.equal(cases.drifted.drift.length, 2);
const limits = {
emptyHome: review(base, base,
manifest(new Map([...published, ['index.html', '']])), allowed),
missingNewBundle: review(base, base,
manifest(new Map([...published, ['index.html', 'Home v2']])),
allowed)
};
assert.equal(limits.emptyHome.pass, true);
assert.equal(limits.missingNewBundle.pass, true);
console.log(JSON.stringify({ node: process.version,
fixture: 'fictional in-memory UTF-8 strings', cases, limits },
null, 2));
Read the rejection, not just the word “false”
The stale candidate produces four differences from the published baseline. The homepage change is expected. The About page and notes index change outside the permitted paths, and the new note disappears outside those paths. That gives three out-of-scope differences and a rejection.
The reconciled candidate produces two differences: the deliberate homepage change and the additional script. All five baseline paths remain present, including the older script. It passes the two predicates implemented here: the baseline has not drifted, and every observed path difference is in the permitted set.
The final case starts with that same candidate, but the published snapshot has moved on. About now contains v3 and a later note has appeared. The comparison finds two baseline differences and rejects the release. A candidate that passed earlier does not carry its approval forward into a changed environment.
| Case | Baseline drift | Candidate differences | Outside permitted paths | Result |
|---|---|---|---|---|
| Stale candidate | 0 | 4 | 3 | Reject |
| Reconciled candidate | 0 | 2 | 0 | Pass these predicates |
| Published snapshot moved on | 2 | 4 | 2 | Reject |
The assertions in the fixture check these expected counts where specified. Keep the returned path lists in a review record. “Three unexpected differences” tells a reviewer less than “About reverted, the notes index reverted and the newer note was removed.”
A permitted path is still a review obligation
The permitted set is intentionally narrow, but membership alone is not correctness. This fixture would also permit the homepage to become an empty string. It would permit assets/ui-b.js to be absent, because it does not require every permitted change to occur. The two additional local controls reproduce those limits: both return true. A permitted set describes where differences may happen; a separate expectation describes what must happen there.
For this release, those expectations would include the reviewed homepage bytes, an existing reference to the intended script, a resolvable script response and a successful reading and interaction check. A real system may encode exact expected digests or a reviewed artifact identity for changed paths. This example leaves that extra contract visible rather than suggesting that a two-condition boolean approves an entire site.
Generated indexes, feeds, sitemaps and shared bundles also need decisions. Some legitimately change when content changes. List each necessary derived output and review its difference. Do not make the entire assets directory an exception simply because one bundle changed. That would erase the boundary the exercise was meant to establish.
Name the artifact that was actually reviewed
A folder name such as dist describes a location, not a version. A branch URL may be similarly movable. Vercel's generated URL documentation distinguishes the address for a specific deployment from the branch address that follows newer deployments. Record the particular artifact or deployment identity used for the review, together with the baseline and comparison result.
The earlier guide to preview deployments and rollbacks covers preview environments and recovery. This comparison adds a different question: what would the complete candidate replace? A reversible deployment can still replace newer content until someone notices and restores it.
An HTTP validator is another kind of evidence. MDN explains that ETag generation is not prescribed: a tag might be based on content, a timestamp or a revision identifier. Do not assume an ETag string is the same digest your manifest calculates. Record the validator separately if it is useful.
Resolve drift in the source of truth
When a comparison reveals newer published content, reconcile the authoritative source or recover the complete approved artifact supported by the hosting system. Review that reconciliation before constructing the replacement release.
Public HTML alone is an incomplete recovery source. It can omit application code, files not linked by the pages you opened, private configuration and state held in external systems. Do not turn this static, in-memory illustration into a recipe for rebuilding an application from downloaded pages.
The scope of an inventory matters too. A path omitted from both snapshots cannot appear in the difference list. State whether the manifest covers the complete public payload, a selected route set or something narrower. Keep private environment files and credentials outside a public release artifact; a list of hashes is not permission to upload the files it describes.
Keep a five-field release record
Before the release, write down five things: the intended outcome; the baseline identity and capture time; the reviewed candidate identity; the exact permitted differences with their expected treatment; and the recovery artifact. Attach the path-by-path comparison instead of summarising it away.
After release, verify the actual public destination and the affected reading paths using the static-site launch checks. Record what was checked and what remains outside the observation. A candidate comparison is pre-release evidence, while public verification establishes what the destination served afterwards.
A one-page change still deserves a whole-release boundary. Preserve the current surrounding site deliberately, identify the differences that are expected and stop when a newer baseline makes the review stale.
Questions and answers
Does a matching hash prove a page is correct?
No. It is evidence about the bytes supplied to the comparison. It cannot establish whether a link works, a caption is truthful, a menu is usable or the baseline is the version that should be preserved.
Should I rebuild a production site by copying public HTML?
No. Reconcile the authoritative source or recover the complete approved artifact for the deployment system. Public HTML does not contain an application's source, private configuration, database or full asset inventory.
Does this script prevent another release during deployment?
No. It reports a difference between supplied snapshots. A deployment lock, version precondition or comparable coordination mechanism is needed to close the gap between checking a baseline and replacing it.
Sources
- Hash and crypto.createHash (Node.js) nodejs.org
- ETag header (MDN) developer.mozilla.org
- Generated deployment URLs (Vercel) vercel.com