clusterflux-public/scripts/release-source-scan.sh
Disasmer release dry run 20c72e6066 Public dry run dryrun-1714a9eedd5b
Source commit: 1714a9eedd5b1e30c6c9aceb7a999f2f695ba83c

Public tree identity: sha256:e5daffad23fa7c7f1822adccd3c3b4ee0bc7f1a45e0d321eb9a6fb8282b269db
2026-07-03 17:31:04 +02:00

71 lines
2 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
repo="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$repo"
release_paths=(
Cargo.toml
Cargo.lock
README.md
crates
examples
private
scripts
vscode-extension
)
existing_release_paths=()
for path in "${release_paths[@]}"; do
if [[ -e "$path" ]]; then
existing_release_paths+=("$path")
fi
done
prose_scan_paths=(
README.md
crates
examples
private
scripts
vscode-extension
)
existing_prose_scan_paths=()
for path in "${prose_scan_paths[@]}"; do
if [[ -e "$path" ]]; then
existing_prose_scan_paths+=("$path")
fi
done
scan_globs=(
--glob '!**/target/**'
--glob '!**/node_modules/**'
--glob '!scripts/release-source-scan.sh'
)
placeholder_pattern='debugger-gate|experiments/debugger-gate|DISASMER-DEMO|device-code-placeholder|artifact://demo|vp-local-demo'
if rg -n "${scan_globs[@]}" "$placeholder_pattern" "${existing_release_paths[@]}"; then
echo "release source scan failed: stale experiment/demo placeholder reference found" >&2
exit 1
fi
demo_setup_pattern='undocumented manual state|hidden setup|demo-only credentials?|hard-coded local paths?'
if rg -n "${scan_globs[@]}" "$demo_setup_pattern" "${existing_prose_scan_paths[@]}"; then
echo "release source scan failed: demo requires hidden setup or demo-only state" >&2
exit 1
fi
hidden_local_pattern='file://|/home/[[:alnum:]_.-]+/|/Users/[[:alnum:]_.-]+/|C:\\Users\\|https?://(localhost|127\.0\.0\.1)[^[:space:]]*/artifacts/'
if rg -n "${scan_globs[@]}" "$hidden_local_pattern" "${existing_release_paths[@]}"; then
echo "release source scan failed: hidden local path or local artifact URL found" >&2
exit 1
fi
public_wording_pattern='reddit|hacker news|lobsters|launch forum|traffic source|free tier'
if rg -n "${scan_globs[@]}" "$public_wording_pattern" "${existing_prose_scan_paths[@]}"; then
echo "release source scan failed: public-facing launch-forum/free-tier wording found" >&2
exit 1
fi
echo "Release source scan passed"