Reproduce the real build
Two incidents, one shape: the environment that proved the change was not the environment
that ships it. A test using ESM-only syntax passed under the test runner and failed the
CommonJS production tsc, blocking the deploy. A build-toolchain upgrade left the lockfile
behind and kept working for two months only because both machines' node_modules had
drifted ahead of it — the first clean reinstall broke everything.
The rules
- Run the exact production build command locally before pushing anything the pipeline compiles — not just the test suite. The test runner tolerates what the release build rejects.
- Prove toolchain fixes from the tracked manifests alone:
npm ciinto a clean directory (nevernpm install, which mutates the lockfile and hides drift). A fix proven only on the machine that produced it has not been proven — that machine'snode_modulesis part of the experiment. - The lockfile describes what ships. If the build only works because installed
dependencies drifted ahead of it, the lockfile is silently wrong and the next
npm ciis the outage.
Why
Build environments drift invisibly toward working, and the drift is per-machine; only a manifest-only reconstruction tests what CI and the next machine will actually see. Evidence: ASH CLAUDE.md Railway/Docker tsc lesson (2026-05-20); ASH LESSONS_LEARNED 2026-07-19.
Additions from the misses-log sweep (2026-10-22)
- A generator can write a resolved path into a tracked file. After a generator runs in a checkout whose dependencies are linked from elsewhere, read
git statusand restore any tracked file that now names another checkout. (ICC L-108.) - The nearest package.json sets a file's module type. A
.jsunder a package with"type": "module"is an ES module to Node whatever it contains; a file shared between a page and CommonJS callers is.cjs, served with an explicit JavaScript content type. (ICC L-115.)
Additions from the misses-log sweep (2026-11-01)
- Pass every shaping flag the generator has a default for. A generator that defaults a
flag produces different output on two machines with the same command, and the difference
reads as drift in the artefact rather than as a bug in the invocation. Name the schema, the
target, the platform and the version explicitly.
supabase gen typeswithout--schemais the worked instance. A regen that differs by machine is a defect in the command, not in the output. (PropOS 2026-08-09.)


