Files
1jehuang--jcode/scripts/antigravity_schema_probe.sh
wehub-resource-sync a789495a98
FreeBSD Smoke / FreeBSD Smoke (x86_64) (push) Has been cancelled
CI / Quality Guardrails (push) Has been cancelled
CI / Build & Test (macos-latest) (push) Has been cancelled
CI / Build & Test (ubuntu-latest) (push) Has been cancelled
CI / Build & Test (windows-latest) (push) Has been cancelled
CI / Format (push) Has been cancelled
CI / PowerShell Syntax (push) Has been cancelled
CI / Windows Cross-Target Check (Linux) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:10:34 +08:00

44 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Isolate which JSON-Schema construct the Antigravity Cloud Code backend's
# Gemini->Anthropic translation rejects for Claude models.
#
# For each JCODE_SCHEMA_STRIP combination, run a single tool-using prompt
# against a Claude model and report PASS (tool ran) / SCHEMA (draft-2020-12
# rejection) / OTHER. Requires a valid Antigravity OAuth session.
set -uo pipefail
JC="${JC:-./target/selfdev/jcode}"
MODEL="${MODEL:-claude-sonnet-4-6}"
PROMPT="${PROMPT:-Run 'echo PROBE_OK' with the bash tool and report the output.}"
TIMEOUT="${TIMEOUT:-120}"
STRIPS=(
"" # baseline (current behaviour)
"anyof"
"addprops"
"numitems"
"anyof,addprops"
"anyof,addprops,numitems"
)
printf "%-28s | %-8s | %s\n" "STRIP" "RESULT" "DETAIL"
printf -- "----------------------------------------------------------------------\n"
for strip in "${STRIPS[@]}"; do
out=$(JCODE_SCHEMA_STRIP="$strip" timeout "$TIMEOUT" \
"$JC" run --provider antigravity -m "$MODEL" --no-update --no-selfdev "$PROMPT" 2>&1)
rc=$?
label="${strip:-<none>}"
if [[ $rc -eq 124 ]]; then
printf "%-28s | %-8s | %s\n" "$label" "TIMEOUT" ""
elif grep -q "PROBE_OK" <<<"$out"; then
printf "%-28s | %-8s | %s\n" "$label" "PASS" "tool executed"
elif grep -qiE "draft 2020|2020-12|schema" <<<"$out"; then
detail=$(grep -oiE "[^\"]{0,60}(draft 2020|2020-12|schema)[^\"]{0,60}" <<<"$out" | head -1 | tr -s ' \n' ' ')
printf "%-28s | %-8s | %s\n" "$label" "SCHEMA" "$detail"
else
detail=$(grep -oiE "HTTP [0-9]+[^\"]{0,80}" <<<"$out" | head -1 | tr -s ' \n' ' ')
printf "%-28s | %-8s | %s\n" "$label" "OTHER" "${detail:-see logs}"
fi
done