fix(supabase): R5.5 gate round 1, final errors, four attempts, keys off argv, runbook
This commit is contained in:
1 parent
a481af52c7
commit
56593af25c
10 files changed
+330
-17
No files matched your search
@@ -11,14 +11,19 @@ set -uo pipefail
|
||||
GUARD="$HOME/.claude/lib/floor-guard.sh"
|
||||
BASE="${1:-develop}"
|
||||
ALLOWED_RE='^FLOOR SUPPRESS \.claude/audits/[^:]+\.md:[0-9]+ '
|
||||
# Declared in the clarification and left to the owner: reported, never requalified, not
|
||||
# counted as a new finding. Anything else outside ALLOWED_RE fails.
|
||||
DECLARED_RE='^FLOOR STUB \.claude/memory/evals\.md:205 '
|
||||
|
||||
# rc 0: every finding is requalified; rc 1: at least one real finding remains.
|
||||
classify() {
|
||||
local report="$1" total requalified remaining
|
||||
total=$(grep -c '^FLOOR [A-Z_]* ' "$report")
|
||||
requalified=$(grep -cE "$ALLOWED_RE" "$report")
|
||||
remaining=$(grep '^FLOOR [A-Z_]* ' "$report" | grep -vE "$ALLOWED_RE")
|
||||
declared=$(grep -E "$DECLARED_RE" "$report")
|
||||
remaining=$(grep '^FLOOR [A-Z_]* ' "$report" | grep -vE "$ALLOWED_RE" | grep -vE "$DECLARED_RE")
|
||||
echo "findings $total, requalified $requalified"
|
||||
[ -z "$declared" ] || { echo "DECLARED (owner decision pending):"; echo "$declared" | cut -c1-200; }
|
||||
[ -z "$remaining" ] || { echo "REMAINING:"; echo "$remaining" | cut -c1-200; return 1; }
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ SEED=supabase/seed/anatomical-sheets/equine/draft
|
||||
BIN=target/release/upload-sheet-assets
|
||||
FAIL=0
|
||||
|
||||
cargo build --release --locked -q -p faunosteo-core --features upload --bin upload-sheet-assets || exit 2
|
||||
env -u SUPABASE_SERVICE_ROLE_KEY cargo build --release --locked -q -p faunosteo-core --features upload --bin upload-sheet-assets || exit 2
|
||||
STATUS=$(bash scripts/supabase.sh status -o json 2>/dev/null) || { echo "stack not running (pnpm db:start)"; exit 2; }
|
||||
field() { printf '%s' "$STATUS" | python3 -c "import json,sys;print(json.load(sys.stdin)['$1'])"; }
|
||||
SERVICE=$(field SERVICE_ROLE_KEY)
|
||||
@@ -26,9 +26,10 @@ LOCAL=http://127.0.0.1:54321
|
||||
expect() {
|
||||
local name=$1 want=$2 url=$3 key=$4; shift 4
|
||||
local out rc
|
||||
out=$(env -i PATH="$PATH" SUPABASE_URL="$url" SUPABASE_SERVICE_ROLE_KEY="$key" "$BIN" "$@" 2>&1); rc=$?
|
||||
# Keys go through the environment of the binary and grep's pattern file, never on an argv.
|
||||
out=$(unset FAUNOSTEO_DEV_HOST; SUPABASE_URL="$url" SUPABASE_SERVICE_ROLE_KEY="$key" "$BIN" "$@" 2>&1); rc=$?
|
||||
LAST=$out
|
||||
if [ "$rc" -eq "$want" ] && ! grep -qF -e "$key" -e "$SERVICE" -e "$ANON" <<<"$out"; then
|
||||
if [ "$rc" -eq "$want" ] && ! grep -qF -f <(printf '%s\n' "$key" "$SERVICE" "$ANON") <<<"$out"; then
|
||||
echo "PASS $name (exit $rc)"
|
||||
else
|
||||
echo "FAIL $name (exit $rc, wanted $want)"; FAIL=1
|
||||
|
||||
@@ -11,4 +11,6 @@ set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
. scripts/rust-env.sh
|
||||
|
||||
exec cargo run --release --locked -q -p faunosteo-core --features upload --bin upload-sheet-assets -- "$@"
|
||||
# Compile without the key in the environment (build scripts never see it), then run the binary.
|
||||
env -u SUPABASE_SERVICE_ROLE_KEY cargo build --release --locked -q -p faunosteo-core --features upload --bin upload-sheet-assets
|
||||
exec target/release/upload-sheet-assets "$@"
|
||||
Reference in new issue
Block a user