fix: the build stamp's check must not depend on a title attribute

Self-review of the previous commit. The assemble-stamp pattern spelled the
whole opening tag, including the title text, so a purely cosmetic edit on
ui/shell-polish -- which is rewriting this header right now -- would have
failed the assembly with a message about a missing cache-bust stamp.

`id` moves last in the tag and the pattern is `id="build-version">TOKEN<`,
which still verifies the token is inside that element and nothing else.
Re-proved discriminating by injecting the missed substitution: exit 1 with
`assemble: refusing to ship; unstamped: .../app/index.html`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FC2jVn8Au7E9JPkw6bwXXH
This commit is contained in:
Edward Langley
2026-09-21 22:49:13 -07:00
parent 90ccfb0154
commit de24c65119
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -12,7 +12,8 @@
#
# Usage: web/assemble.sh [OUT_DIR] [CACHE_BUST_TOKEN]
#
# The token cache-busts the two generated bundles. Pages serves everything
# The token cache-busts the two generated bundles and names the build in the
# page's own #build-version (improvise-oujb). Pages serves everything
# `max-age=600` and the wasm-pack filenames carry no content hash, so for ten
# minutes after a deploy a returning visitor runs the PREVIOUS build — which
# during improvise-9x6 debugging made a shipped fix look like it had not
@@ -84,7 +85,7 @@ sedi "s|'improvise_worker_server_bg\.wasm'|'improvise_worker_server_bg.wasm?v=${
# (improvise-w8ih). Its argument is FILE PATTERN, five times -- the page's own
# #build-version among them (improvise-oujb).
sh "$root/scripts/assemble-stamp.sh" \
"$app/index.html" "id=\"build-version\" title=\"Build this page was assembled from\">${token}<" \
"$app/index.html" "id=\"build-version\">${token}<" \
"$app/app.js" "pkg/improvise_wasm_client.js?v=${token}" \
"$app/worker.js" "worker-pkg/improvise_worker_server.js?v=${token}" \
"$app/pkg/improvise_wasm_client.js" "improvise_wasm_client_bg.wasm?v=${token}" \
+1 -1
View File
@@ -44,7 +44,7 @@
or commit it assembled from (improvise-oujb). A page served straight
out of web/ was never assembled and honestly says so.
-->
<span id="build-version" title="Build this page was assembled from">unstamped</span>
<span title="Build this page was assembled from" id="build-version">unstamped</span>
</header>
<!--