Files
improvise/harness/build.sh
T
Edward Langley 1550d390cb pr-reviews re-polls after a slow tick; the harness lock fails loudly
improvise-qnpi: `pr-reviews --wait` checked its deadline before the first
re-poll, so a second boundary between two reads of the clock skipped the
only poll (exit 1 with polls=1, reproduced under CPU load). The deadline
is now checked after each poll. A new case drives it with a PATH shim
whose `date` ticks one second per read, so it fails deterministically on
the old loop rather than under load.

improvise-mkbp: harness/opfs-contract/Cargo.lock pinned pest 2.9.1 while
its path deps require 2.9.2, so every build rewrote it. The resolved lock
is committed and build.sh starts with `cargo metadata --locked`; the
wasm-pack `-- --locked` route was tried and does not work (wasm-pack
re-resolves first). opfs.spec.js now names the fix when harness/serve/opfs
is missing, which is what running web/assemble.sh alone leaves.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VdfEGXA7aJ6ftMsCc9PJze
2026-09-22 23:36:00 -07:00

47 lines
2.2 KiB
Bash
Executable File

#!/bin/sh
# Build everything the browser harness serves, into harness/serve/.
#
# harness/serve/ the assembled site, exactly as `web/assemble.sh`
# produces it for GitHub Pages
# harness/serve/opfs/ this harness's own page, worker and wasm bundle
#
# One server root, so Playwright runs one `python3 -m http.server`. The site
# half is the *deployed* arrangement rather than `web/` itself, because a
# harness that runs against a different tree from the one that ships is
# testing something nobody deploys (improvise-vvl3).
#
# Re-run THIS script, never `web/assemble.sh harness/serve` alone: assembling
# starts with `rm -rf` of its output, which deletes opfs/ and the fixtures
# (improvise-mkbp). opfs.spec.js says so if it finds opfs/ missing.
set -eu
root=$(cd "$(dirname "$0")/.." && pwd)
serve="$root/harness/serve"
# A stale opfs-contract/Cargo.lock fails HERE rather than being rewritten in
# every agent's tree (improvise-mkbp). wasm-pack cannot enforce this: it
# re-resolves the lock itself before any `-- --locked` reaches cargo build.
# Fix a failure with `cargo update -w` in harness/opfs-contract, and commit it.
cargo metadata --locked --format-version 1 \
--manifest-path "$root/harness/opfs-contract/Cargo.toml" >/dev/null
"$root/web/build.sh" >/dev/null
"$root/web/assemble.sh" "$serve" harness >/dev/null
# The harness's own documents, beside the shipped one. `web/demo.improv` is
# the front page and stays as it is (gotcha 46); a grouped, multi-level model
# is the only way to reach the header-level, group-span and collapse paths
# `improvise-anr9` added (improvise-plcx). A seed that 404s is NOT an error --
# worker.js answers it with an empty model -- so every spec over these asserts
# real labels rather than that a grid exists.
cp -f "$root"/harness/fixtures/*.improv "$serve/app/"
wasm-pack build "$root/harness/opfs-contract" \
--target web --out-dir "$root/harness/www/opfs/pkg"
mkdir -p "$serve/opfs"
cp -f "$root/harness/www/opfs/index.html" "$root/harness/www/opfs/worker.js" "$serve/opfs/"
cp -rf "$root/harness/www/opfs/pkg" "$serve/opfs/pkg"
rm -f "$serve/opfs/pkg/.gitignore" "$serve/opfs/pkg/package.json"
echo "harness/serve ready"