fix: verify-build diagnostic overstates the failure, and two robustness gaps in the same script #180
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Three non-blocking findings from the independent review of PR #178 (issue
#170), all in
script/verify-buildor its coupling tobuild.js. Groupedbecause they are one small pass over one file.
Depends on #178 landing first.
1. The diagnostic claims a worse failure than actually occurs
script/verify-build:55-57reports, when a bundle carries both markers:> the build-time DEBUG value was never resolved and the debug branch is still
> live
The reviewer inspected the actual emitted output with the define removed:
In extension context
__BUILD_DEBUG__is undeclared, soDEBUGevaluates tofalse at runtime. The debug branch is not live and the artifact is not
drainable. The fallback goes the safe way.
The same overstatement appears in PR #178's commit body and originates in issue
#170's own text, which I wrote — I reasoned from the source and assumed the
fallback went the unsafe way, without checking the compiled output. That was my
error, not the implementer's; they inherited it.
What actually goes wrong is still worth failing the build over:
DEBUGis nolonger resolved at build time. The release/debug distinction has silently
stopped being enforced, and which way the unresolved fallback happens to
evaluate is then an accident that a future refactor can flip. That is a broken
build contract. It is just not a live funds-loss bug, and the message should
not say it is.
Requirements
script/verify-build:55-57to state the real failure:the build-time DEBUG value was never resolved, so the release/debug
distinction is no longer enforced. Keep it a hard failure.
overstatement while you are there, and say in the PR whether any needed
changing.
2.
grepexit 2 is conflated with exit 1script/verify-build:38uses2>/dev/null, which merges "grep could not readthe file" (exit 2) with "no match" (exit 1).
An unreadable bundle therefore fails safe — it is reported as carrying no
marker, which is a hard failure — but it is misdiagnosed, telling the
operator the emitted output changed shape when the real problem is a
permissions or I/O fault. The reviewer confirmed the fail-safe behaviour by
chmod 000on a bundle.Requirements
accurate message for the unreadable case.
3.
*.jscoupling between two filesbuild.js:35andscript/verify-build:76both filter to*.js. A futurebundle emitted with a different extension would escape both the manifest
and the unlisted-bundle cross-check — silently, in both places at once, which
is exactly the correlated-blind-spot failure the two-source design exists to
avoid.
Requirements
self-checking so the two cannot drift apart. Deriving the extension set from
one place is better than repeating the literal.
site naming the other, and explain in the PR why a shared source was not
practical.
Explicitly not in scope
Recorded as considered and rejected, so they are not re-raised:
_filevariable atscript/verify-build:48-52and:77— latent, safe today.
read -rnot representing paths with leading or trailing whitespace.AUTISTMASK_DEBUG=1 make buildblessing a debug artifact as verified — thisis explicitly required by #170, and Docker CI does not inherit host env.
Definition of done
fails.
fails.
*.jsassumption exists in one place, or the coupling is explicitand documented at both sites.
and say so in the PR.
make build,make build-debug, andmake checkall green.TODO.mdupdated in the same commit.clawbot referenced this issue2026-08-10 16:16:05 +02:00