With AUTISTMASK_DEBUG=1 exported in the calling shell, make build compiled a debug bundle and failed on it in script/verify-build, but left the bundle in dist/: loadable, with every wallet it creates using the publicly committed test recovery phrase from src/shared/constants.js. A failed release build that leaves a loadable debug build behind is the trap the verifier exists to close. Every step of make build now runs through script/discard-dist-on-failure, which removes dist/ when its step fails and says on stderr that it did and why, then returns the step's own exit status. A removal it cannot complete is reported as loudly as one it can, naming what is still on disk. A step that succeeds removes nothing, including the final check-censored --require-dist pass. It composes with the existing receipt trap: the receipt is still deleted on the way out. make build-debug is deliberately not wrapped. A debug build that failed is not producing an artifact mistakable for a release one, and its dist/ is the evidence of what went wrong. script/test-verify-build asserts the state of dist/ on disk after a failing and a succeeding step rather than the exit status alone, plus a step that fails with no dist/ and a wrapper handed no command, and reads make -n to check the wrapper is on the release path and absent from the debug one. Both directions were also run end to end: AUTISTMASK_DEBUG=1 make build fails and leaves no dist/, plain make build passes with all 15 emitted files intact, and a debug build failed mid-write keeps its dist/. verify-build itself is unchanged; this is only what happens after it says no.
31 KiB
Executable File
31 KiB
Executable File