From a084dce780ec0bdbe4e1107576b3df8931a18568 Mon Sep 17 00:00:00 2001 From: Marius Ciepluch <11855163+norandom@users.noreply.github.com> Date: Tue, 22 Sep 2026 21:56:20 +0200 Subject: [PATCH] test(push): a verified source freeze for long measurement runs Every long run mounts src into a container, and mounting the working tree is a live mount: edits made during a multi-hour run are picked up mid-run, and a measurement whose code changed underneath it is not a measurement of anything. A five-hour PHP transfer replay was lost that way today. The export has to be checked too. git archive piped into tar once produced a tree missing the whole ontology -- every tracked file after groovy alphabetically -- and reported success, because tar status in a pipeline was never read. Every scan on that tree died at its first fact load and looked like a slow run for fourteen minutes. So: archive to a file, extract, count against git, and refuse an export without the ontology. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01EmM1j46qgKMh3zqD1QMwEo --- benchmarks/push/freeze_source.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 benchmarks/push/freeze_source.sh diff --git a/benchmarks/push/freeze_source.sh b/benchmarks/push/freeze_source.sh new file mode 100755 index 0000000..a1802ee --- /dev/null +++ b/benchmarks/push/freeze_source.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# Export the COMMITTED source for a long measurement run, and prove the export is whole. +# +# Every long run here mounts src into a container. Mounting the working tree is a live mount: edits +# made during a multi-hour run are picked up mid-run, and a measurement whose code changed underneath +# it is not a measurement of anything -- the failure looks exactly like the thing being measured +# failing. A five-hour PHP transfer replay was lost that way on 2026-09-22. +# +# And the export has to be checked. `git archive | tar -x` once produced a tree missing the whole +# ontology (every tracked file after `groovy` alphabetically) and reported success, because tar's +# status in a pipeline was never read. Every scan on that tree died at its first fact load and looked +# like a slow run for fourteen minutes. So: archive to a file, extract, count against git. +# +# Usage: benchmarks/push/freeze_source.sh -> prints the frozen commit on success +set -euo pipefail +dest="${1:?destination directory}" +rm -rf "$dest" && mkdir -p "$dest" +git archive HEAD src benchmarks > "$dest.tar" +tar -xf "$dest.tar" -C "$dest" +rm -f "$dest.tar" +want=$(git ls-files src benchmarks | wc -l) +have=$(find "$dest" -type f | wc -l) +if [ "$want" -ne "$have" ]; then + echo "TRUNCATED export: git tracks $want files, export holds $have" >&2 + exit 1 +fi +test -d "$dest/src/openultrasast/ruleset/semantic" || { echo "export lacks the ontology" >&2; exit 1; } +echo "$(git rev-parse --short HEAD) $have files"