fix: harden P1 integration evidence

This commit is contained in:
2026-08-09 21:14:45 +02:00
parent 74ddb86d13
commit 3583659600
5 changed files with 460 additions and 119 deletions
+6 -2
View File
@@ -8,10 +8,14 @@ fi
for command in node npm git; do command -v "$command" >/dev/null || { printf 'missing command: %s\n' "$command" >&2; exit 127; }; done
THT_BIN="${THT_BIN:-$repo_root/harness/.venv/bin/tht}"
[[ "$THT_BIN" = /* && -x "$THT_BIN" ]] || { printf 'THT_BIN must be an absolute executable path\n' >&2; exit 127; }
export THT_BIN
npm --prefix "$repo_root/backend" run build
safe_env=(env -i "PATH=$PATH" "HOME=${HOME:-/nonexistent}" "LANG=${LANG:-C}" "THT_BIN=$THT_BIN")
for name in LC_ALL TMPDIR TZ; do
[[ -n "${!name:-}" ]] && safe_env+=("$name=${!name}")
done
[[ -n "${P1_ACCEPTANCE_FAIL_AT:-}" ]] && safe_env+=("P1_ACCEPTANCE_FAIL_AT=$P1_ACCEPTANCE_FAIL_AT")
set +e
node "$repo_root/backend/scripts/p1-acceptance.mjs" "$@"
"${safe_env[@]}" node "$repo_root/backend/scripts/p1-acceptance.mjs" "$@"
status=$?
set -e
exit "$status"
+3
View File
@@ -1,5 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
bash -n "$repo_root/scripts/p1-acceptance.sh" "$repo_root/scripts/test-p1-acceptance.sh"
node --check "$repo_root/backend/scripts/p1-acceptance.mjs"
node --check "$repo_root/backend/scripts/p1-acceptance.test.mjs"
npm --prefix "$repo_root/backend" run build
node --test "$repo_root/backend/scripts/p1-acceptance.test.mjs"