From a5acd49d9e45a7a4d866920e91113d122ac66b57 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Wed, 25 Nov 2026 04:22:18 -0800 Subject: [PATCH] Run newer Claude Code and Codex in CI, and read the Astra model from the registry (GST-3801) (#4822) CI now runs Claude Code 2.1.326 and Codex 0.172.0, which know gstack's newest default models, and the Capy installer reads its Codex model from `lib/model-families.ts`. Why: the old pins priced the default judge as an older Fable and had no GPT-6.2 metadata, and the installer named the Astra id by hand. Heads-up: the test harness's version moves to 8, so every paid case starts a new pass-rate series. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Review-Finding: voices/outside-voice#1 reader=outside-voice Review-Finding: voices/outside-voice#2 reader=outside-voice Review-Finding: voices/outside-voice#3 reader=outside-voice Review-Finding: voices/outside-voice#4 reader=outside-voice --- .github/docker/Dockerfile.ci | 23 +- bin/gstack-capy-install | 10 +- changelog.d/newer-cli-pins-and-judge-check.md | 6 + docs/capy-install.md | 7 +- lib/eval-model.ts | 5 +- .../scripts/lib/paid-cases.ts.json | 2 +- .../scripts/lib/paid-plan.ts.json | 2 +- .../scripts/lib/paid-report.ts.json | 2 +- .../scripts/lib/published-text.ts.json | 2 +- .../scripts/lib/shard-engine.ts.json | 2 +- .../scripts/test-paid-shards.ts.json | 2 +- .../scripts/test-pr-profile.ts.json | 2 +- .../scripts/test-strict-output.ts.json | 2 +- .../test/helpers/agent-sdk-runner.ts.json | 2 +- .../test/helpers/auq-substance-panel.ts.json | 2 +- .../test/helpers/claude-pty-runner.ts.json | 2 +- .../test/helpers/codex-host-runner.ts.json | 2 +- .../test/helpers/codex-session-runner.ts.json | 2 +- .../test/helpers/e2e-gate.ts.json | 2 +- .../test/helpers/e2e-helpers.ts.json | 2 +- .../test/helpers/eval-budgets.ts.json | 2 +- .../test/helpers/eval-store.ts.json | 2 +- .../test/helpers/hermetic-env.ts.json | 2 +- .../test/helpers/llm-judge.ts.json | 2 +- .../test/helpers/paid-test-set.ts.json | 2 +- .../test/helpers/pty-screen.ts.json | 2 +- .../harness-pins/test/helpers/pty/auq.ts.json | 2 +- .../test/helpers/pty/binary.ts.json | 2 +- .../test/helpers/pty/boundaries.ts.json | 2 +- .../test/helpers/pty/classify.ts.json | 2 +- .../test/helpers/pty/fake-session.ts.json | 2 +- .../test/helpers/pty/judge.ts.json | 2 +- .../test/helpers/pty/launch.ts.json | 2 +- .../test/helpers/pty/plan-native.ts.json | 2 +- .../test/helpers/pty/runners/counting.ts.json | 2 +- .../test/helpers/pty/runners/floor.ts.json | 2 +- .../helpers/pty/runners/observation.ts.json | 2 +- .../test/helpers/pty/screen.ts.json | 2 +- .../test/helpers/pty/session.ts.json | 2 +- .../test/helpers/pty/transcript-cost.ts.json | 2 +- .../test/helpers/session-drain-policy.ts.json | 2 +- .../test/helpers/session-ledger.ts.json | 2 +- .../test/helpers/session-runner.ts.json | 2 +- .../test/helpers/skill-fixture.ts.json | 2 +- .../test/helpers/skill-startup.ts.json | 2 +- .../test/helpers/test-selection.ts.json | 2 +- .../test/helpers/touchfiles.ts.json | 2 +- scripts/harness-version.json | 2 +- test/fixtures/judge-calibration/README.md | 29 +++ test/gstack-capy-install.test.ts | 31 ++- test/helpers/bootstrap-retention.ts | 2 +- test/helpers/hermetic-env.ts | 4 +- test/helpers/llm-judge.ts | 3 +- test/helpers/shared-libs-eval-fixture.ts | 27 ++- test/shared-libs-fixture.test.ts | 205 ++++++++++++++++++ test/skill-e2e-safety-codex-boundary.test.ts | 2 +- 56 files changed, 363 insertions(+), 77 deletions(-) create mode 100644 changelog.d/newer-cli-pins-and-judge-check.md diff --git a/.github/docker/Dockerfile.ci b/.github/docker/Dockerfile.ci index 1ed8c693d..2d02887ab 100644 --- a/.github/docker/Dockerfile.ci +++ b/.github/docker/Dockerfile.ci @@ -148,15 +148,15 @@ RUN case "${TARGETARCH:-amd64}" in \ # skillify HOME discovery on 2.1.237, guard/freeze hooks on 2.1.162). # Bump deliberately, via a PR that runs the PTY gate against the new TUI. # test/ci-image-cli-pin.test.ts fails the free suite if this pin is removed. -# 2.1.292 is the npm latest users run (October 2026). On it the fork-subagent -# gate is on by default in interactive sessions: the Agent schema drops -# run_in_background and reviewers run in the background, which broke the -# /autoplan publication guard while CI still ran 2.1.284 and never saw it. -# Pinning the version users run is the point; the daily +# 2.1.326 is npm's `stable` release (November 2026), the version users on +# the stable channel run. Pinning a version users run is the point; the daily # autoplan-schema-canary case watches the latest release ahead of the pin. -# (2.1.284 was the first pin to recognize the eval model claude-fable-5-1; -# 2.1.292 keeps that profile.) -RUN npm i -g @anthropic-ai/claude-code@2.1.292 +# 2.1.292, the pin before it, had no claude-fable-5-2 entry and priced the +# default eval judge at the older Fable rate; 2.1.326 knows claude-fable-5-1 (the +# arm benchmark's judge) and claude-fable-5-2 (every other judge). Since +# 2.1.292 the fork-subagent gate is on by default in interactive sessions: +# the Agent schema drops run_in_background and reviewers run in the background. +RUN npm i -g @anthropic-ai/claude-code@2.1.326 # Codex CLI — exact pin, same discipline as the claude pin above, so the # Codex eval files execute in CI instead of self-skipping. Installed OFF PATH: @@ -165,9 +165,12 @@ RUN npm i -g @anthropic-ai/claude-code@2.1.292 # directory on PATH only for the Codex files (scripts/lib/paid-cases.ts scopeCodexAccess). # The image carries no credential: the eval workflows run `codex login # --with-api-key` from the OPENAI_API_KEY secret in same-repo runs only -# (codex 0.160.0 does not read OPENAI_API_KEY from the environment). +# (codex 0.160.0 did not read OPENAI_API_KEY from the environment; the login +# step stays for every pin). +# 0.172.0 carries model metadata for gpt-6.2-sol and gpt-6.2-astra, which +# 0.160.0 lacked, and meets the 0.170.0 floor gstack's Codex hooks need. ENV GSTACK_CI_CODEX_BIN_DIR=/opt/codex/bin -RUN npm i -g --prefix=/opt/codex @openai/codex@0.160.0 \ +RUN npm i -g --prefix=/opt/codex @openai/codex@0.172.0 \ && test -x /opt/codex/bin/codex \ && ! command -v codex diff --git a/bin/gstack-capy-install b/bin/gstack-capy-install index e503bbc11..1be438995 100755 --- a/bin/gstack-capy-install +++ b/bin/gstack-capy-install @@ -15,7 +15,9 @@ # release archive, SHA-256 verified, is published in the runtime store # /runtimes/bun//bun, GSTACK_BUN_INSTALL_VERSION # overriding the default); ./setup -# --host claude --no-prefix; ./setup --host codex --model gpt-6.2-astra (both +# --host claude --no-prefix; ./setup --host codex --model (both # skipped when this HEAD was already set up and the check passes); # gstack-doctor --check with the launch PATH; the install verdict # (bin/gstack-install-verdict.sh), keyed by checkout and project and holding @@ -420,7 +422,8 @@ export GSTACK_SKIP_COREUTILS="${GSTACK_SKIP_COREUTILS:-1}" GSTACK_SKIP_ASIDE="${ BROWSER_FLAG="--no-browser"; [ "$WITH_BROWSER" -eq 1 ] && BROWSER_FLAG="" HEAD_SHA=$(git -C "$ROOT" rev-parse HEAD 2>/dev/null || true) SETUP_STATE="$(git -C "$ROOT" rev-parse --absolute-git-dir 2>/dev/null || echo "$ROOT/.git")/gstack-capy-install.state" -SETUP_RECORD="head=$HEAD_SHA hosts=claude,codex model=gpt-6.2-astra browser=$WITH_BROWSER" +CODEX_MODEL=""; [ -f lib/model-families.ts ] && CODEX_MODEL=$(sed -n "s/^ *{ family: 'astra', provider: '[a-z]*', model: '\([A-Za-z0-9._-]*\)' },\{0,1\}$/\1/p" lib/model-families.ts | head -1) +SETUP_RECORD="head=$HEAD_SHA hosts=claude,codex model=$CODEX_MODEL browser=$WITH_BROWSER" if [ -n "$FOR" ]; then set -- --for "$FOR"; else set -- --require "$REQUIRE"; fi [ "$WITH_BROWSER" -eq 1 ] && [ -z "$FOR" ] && set -- --require "$REQUIRE,browse-bundle,browser" certify() { OUT=$(cd "$ORIG_PWD" && GSTACK_EPHEMERAL="${GSTACK_EPHEMERAL:-1}" "$ROOT/bin/gstack-doctor" --check "$@" ${PROJECT:+--project "$PROJECT"} ${MIN_REVISION:+--min-revision "$MIN_REVISION"} 2>&1); RC=$?; } @@ -476,8 +479,9 @@ if [ "$CHECK_ONLY" -eq 0 ] && [ "$PROFILE" -eq 0 ] && [ -z "${GSTACK_CAPY_UPGRAD fi if [ "$CHECK_ONLY" -eq 0 ] && [ "$SKIPPED" -eq 0 ] && [ "$PROFILE" -eq 0 ]; then T1=$(now) + [ -n "$CODEX_MODEL" ] || [ ! -f lib/model-families.ts ] || setup_failed "could not read the astra model from $ROOT/lib/model-families.ts" ./setup --host claude --no-prefix $BROWSER_FLAG "$SETUP_STATE" 2>/dev/null diff --git a/changelog.d/newer-cli-pins-and-judge-check.md b/changelog.d/newer-cli-pins-and-judge-check.md new file mode 100644 index 000000000..4d13dfc9d --- /dev/null +++ b/changelog.d/newer-cli-pins-and-judge-check.md @@ -0,0 +1,6 @@ +### Changed + +- **The CI image now runs Claude Code 2.1.326 and Codex 0.172.0, versions that know gstack's newest default models.** Claude Code 2.1.292 had no entry for claude-fable-5-2, the default eval judge, and Codex 0.160.0 had no metadata for gpt-6.2-sol or gpt-6.2-astra. Both new versions were checked. Their binaries carry those model ids, and Codex 0.172.0 answered on both GPT-6.2 models. +- `bin/gstack-capy-install` reads the Codex setup model from the astra row of `lib/model-families.ts` instead of naming it, so the next Astra release is still a one-line change. An unreadable registry fails setup before either host runs. +- The default judge's move to claude-fable-5-2 is checked against the labelled controls next to its callers (plan-decision and DX peer-comparison calibrations, the redaction semantic pass): every item agreed with its label. The record and the callers that have no labelled outputs yet are in `test/fixtures/judge-calibration/README.md`. +- The test harness keeps working on Claude Code 2.1.326. Its PTY sessions pre-trust their own disposable test directories, because 2.1.326 now asks before using an `--add-dir` folder it hasn't seen and the prompt defaults to exit. The shared-code read-only check recognizes 2.1.326's own startup Git calls, which add two hardening settings. The bootstrap check accepts the larger 2.1.326 binary (371 MB, past the old 256 MiB limit). diff --git a/docs/capy-install.md b/docs/capy-install.md index 72aff8cc0..48bed5d87 100644 --- a/docs/capy-install.md +++ b/docs/capy-install.md @@ -355,7 +355,12 @@ uses it to refuse a base merge under an open run whatever node the launch PATH gives, and a Node mismatch names the node it read and the installer command that fixes it. 3. `./setup --host claude --no-prefix`, then `./setup --host codex --model - gpt-6.2-astra`, both with `--no-browser`. Skipped when this exact HEAD was set + `, both with `--no-browser`, where `` is the astra row of + `lib/model-families.ts`. A checkout without that file (an older revision) + runs `./setup --host codex` without `--model`, so setup keeps its own + default; when the file exists but its astra row cannot be read, the + installer stops with `gstack: fail setup` before either setup runs. + Skipped when this exact HEAD was set up with the same hosts, model and browser flag (recorded in the git dir after a successful setup) and `gstack-doctor --check` passes; a warm rerun takes about a second. Each setup ends with its own `gstack ready ()`; diff --git a/lib/eval-model.ts b/lib/eval-model.ts index 3b87f4d78..f225521ba 100644 --- a/lib/eval-model.ts +++ b/lib/eval-model.ts @@ -26,8 +26,9 @@ export const CLAUDE_CAPTURE_EVAL_MODEL = newestModel("opus"); /** * The judge is the ruler, not the model under test, and it is the newest Fable * (Garry, 2026-11-24: "gstack should always be using latest astra, sol, fable or - * opus"). The calibration fixtures in test/fixtures/judge-calibration record - * the earlier Fable they were measured on. + * opus"). Its check on claude-fable-5-2 against labelled controls is recorded in + * test/fixtures/judge-calibration/README.md; the arm benchmark keeps its own + * pinned judge (ARM_JUDGE_MODEL in test/helpers/llm-judge.ts). */ export const CLAUDE_JUDGE_EVAL_MODEL = newestModel("fable"); export const DEFAULT_JUDGE_MAX_TOKENS = 8192; diff --git a/scripts/harness-pins/scripts/lib/paid-cases.ts.json b/scripts/harness-pins/scripts/lib/paid-cases.ts.json index 05bf849a7..20717092d 100644 --- a/scripts/harness-pins/scripts/lib/paid-cases.ts.json +++ b/scripts/harness-pins/scripts/lib/paid-cases.ts.json @@ -1 +1 @@ -{"blob":"b88614aba91757dc9cd096e2333533de3bd57efe","since":7} +{"blob":"b88614aba91757dc9cd096e2333533de3bd57efe","since":8} diff --git a/scripts/harness-pins/scripts/lib/paid-plan.ts.json b/scripts/harness-pins/scripts/lib/paid-plan.ts.json index 0cb213ef2..2139e795d 100644 --- a/scripts/harness-pins/scripts/lib/paid-plan.ts.json +++ b/scripts/harness-pins/scripts/lib/paid-plan.ts.json @@ -1 +1 @@ -{"blob":"e8ce3cb98474dded38c5128a631d283b0ca35b63","since":7} +{"blob":"e8ce3cb98474dded38c5128a631d283b0ca35b63","since":8} diff --git a/scripts/harness-pins/scripts/lib/paid-report.ts.json b/scripts/harness-pins/scripts/lib/paid-report.ts.json index 49f98059a..55b2062d3 100644 --- a/scripts/harness-pins/scripts/lib/paid-report.ts.json +++ b/scripts/harness-pins/scripts/lib/paid-report.ts.json @@ -1 +1 @@ -{"blob":"31355b5a97706943e5fccb2946adeba5fa17a08c","since":7} +{"blob":"31355b5a97706943e5fccb2946adeba5fa17a08c","since":8} diff --git a/scripts/harness-pins/scripts/lib/published-text.ts.json b/scripts/harness-pins/scripts/lib/published-text.ts.json index 699a5deb8..af10d4aee 100644 --- a/scripts/harness-pins/scripts/lib/published-text.ts.json +++ b/scripts/harness-pins/scripts/lib/published-text.ts.json @@ -1 +1 @@ -{"blob":"3f2e4d616b5dd0204035710c66b64d49055c5714","since":7} +{"blob":"3f2e4d616b5dd0204035710c66b64d49055c5714","since":8} diff --git a/scripts/harness-pins/scripts/lib/shard-engine.ts.json b/scripts/harness-pins/scripts/lib/shard-engine.ts.json index bcd484702..bbe2be486 100644 --- a/scripts/harness-pins/scripts/lib/shard-engine.ts.json +++ b/scripts/harness-pins/scripts/lib/shard-engine.ts.json @@ -1 +1 @@ -{"blob":"77f0039e555cf695bdda02e123b4d6af6d378682","since":7} +{"blob":"77f0039e555cf695bdda02e123b4d6af6d378682","since":8} diff --git a/scripts/harness-pins/scripts/test-paid-shards.ts.json b/scripts/harness-pins/scripts/test-paid-shards.ts.json index 591f14636..07cc5c0d6 100644 --- a/scripts/harness-pins/scripts/test-paid-shards.ts.json +++ b/scripts/harness-pins/scripts/test-paid-shards.ts.json @@ -1 +1 @@ -{"blob":"5439d0a8f6e1569fa7c924af20d67c30c81d5d30","since":7} +{"blob":"5439d0a8f6e1569fa7c924af20d67c30c81d5d30","since":8} diff --git a/scripts/harness-pins/scripts/test-pr-profile.ts.json b/scripts/harness-pins/scripts/test-pr-profile.ts.json index ee85d1df3..762520890 100644 --- a/scripts/harness-pins/scripts/test-pr-profile.ts.json +++ b/scripts/harness-pins/scripts/test-pr-profile.ts.json @@ -1 +1 @@ -{"blob":"9384e521785e31e99eae4c0f126f67bb2d174260","since":7,"nonBehavioral":"GST-3386 adds .github/workflows/mutation-report.yml to FREE_ONLY_PR_FILES in scripts/test-pr-profile.ts: the new workflow is a weekly report-only job on main, so it only classifies that file as free-lane in the workflow inventory; no paid case's selection, prompt, threshold, samples or verdict can change"} +{"blob":"9384e521785e31e99eae4c0f126f67bb2d174260","since":8} diff --git a/scripts/harness-pins/scripts/test-strict-output.ts.json b/scripts/harness-pins/scripts/test-strict-output.ts.json index a0fd8d687..a15798e51 100644 --- a/scripts/harness-pins/scripts/test-strict-output.ts.json +++ b/scripts/harness-pins/scripts/test-strict-output.ts.json @@ -1 +1 @@ -{"blob":"01185d20dc9761b04b9b2f751ec98664fe0eaf93","since":7} +{"blob":"01185d20dc9761b04b9b2f751ec98664fe0eaf93","since":8} diff --git a/scripts/harness-pins/test/helpers/agent-sdk-runner.ts.json b/scripts/harness-pins/test/helpers/agent-sdk-runner.ts.json index e2e219d29..41d8dc570 100644 --- a/scripts/harness-pins/test/helpers/agent-sdk-runner.ts.json +++ b/scripts/harness-pins/test/helpers/agent-sdk-runner.ts.json @@ -1 +1 @@ -{"blob":"d66dac458b8c13250973e550edf8087d4044cd0b","since":7} +{"blob":"d66dac458b8c13250973e550edf8087d4044cd0b","since":8} diff --git a/scripts/harness-pins/test/helpers/auq-substance-panel.ts.json b/scripts/harness-pins/test/helpers/auq-substance-panel.ts.json index 6d8cc6795..a16e08aa2 100644 --- a/scripts/harness-pins/test/helpers/auq-substance-panel.ts.json +++ b/scripts/harness-pins/test/helpers/auq-substance-panel.ts.json @@ -1 +1 @@ -{"blob":"4881260ef793668e4963a062db6d06a5e1f7a40f","since":7} +{"blob":"4881260ef793668e4963a062db6d06a5e1f7a40f","since":8} diff --git a/scripts/harness-pins/test/helpers/claude-pty-runner.ts.json b/scripts/harness-pins/test/helpers/claude-pty-runner.ts.json index b37126537..37fa4179b 100644 --- a/scripts/harness-pins/test/helpers/claude-pty-runner.ts.json +++ b/scripts/harness-pins/test/helpers/claude-pty-runner.ts.json @@ -1 +1 @@ -{"blob":"ce7a5eaa66e502a052ea9c53348dd2ab25db6148","since":7} +{"blob":"ce7a5eaa66e502a052ea9c53348dd2ab25db6148","since":8} diff --git a/scripts/harness-pins/test/helpers/codex-host-runner.ts.json b/scripts/harness-pins/test/helpers/codex-host-runner.ts.json index 69acec918..55456666d 100644 --- a/scripts/harness-pins/test/helpers/codex-host-runner.ts.json +++ b/scripts/harness-pins/test/helpers/codex-host-runner.ts.json @@ -1 +1 @@ -{"blob":"4596f41514cf87e2fe5f1791c00ea4991cba548c","since":7} +{"blob":"4596f41514cf87e2fe5f1791c00ea4991cba548c","since":8} diff --git a/scripts/harness-pins/test/helpers/codex-session-runner.ts.json b/scripts/harness-pins/test/helpers/codex-session-runner.ts.json index c665fa2f7..ce7f35b93 100644 --- a/scripts/harness-pins/test/helpers/codex-session-runner.ts.json +++ b/scripts/harness-pins/test/helpers/codex-session-runner.ts.json @@ -1 +1 @@ -{"blob":"c040ebbfa815b8cce19ef80c6133bd5a5474149a","since":7} +{"blob":"c040ebbfa815b8cce19ef80c6133bd5a5474149a","since":8} diff --git a/scripts/harness-pins/test/helpers/e2e-gate.ts.json b/scripts/harness-pins/test/helpers/e2e-gate.ts.json index df6e538c3..4d7e67fa3 100644 --- a/scripts/harness-pins/test/helpers/e2e-gate.ts.json +++ b/scripts/harness-pins/test/helpers/e2e-gate.ts.json @@ -1 +1 @@ -{"blob":"efb7e197dd5f66c3ad0e34074b14e640754f7a45","since":7} +{"blob":"efb7e197dd5f66c3ad0e34074b14e640754f7a45","since":8} diff --git a/scripts/harness-pins/test/helpers/e2e-helpers.ts.json b/scripts/harness-pins/test/helpers/e2e-helpers.ts.json index c896331c8..03dd49b18 100644 --- a/scripts/harness-pins/test/helpers/e2e-helpers.ts.json +++ b/scripts/harness-pins/test/helpers/e2e-helpers.ts.json @@ -1 +1 @@ -{"blob":"91996ff2bc303ee29f4e6f1705d1468b2536b32e","since":7} +{"blob":"91996ff2bc303ee29f4e6f1705d1468b2536b32e","since":8} diff --git a/scripts/harness-pins/test/helpers/eval-budgets.ts.json b/scripts/harness-pins/test/helpers/eval-budgets.ts.json index 569900506..18fb6abd7 100644 --- a/scripts/harness-pins/test/helpers/eval-budgets.ts.json +++ b/scripts/harness-pins/test/helpers/eval-budgets.ts.json @@ -1 +1 @@ -{"blob":"5a16324a47b7c3c770e64322ae357f90c405a249","since":7} +{"blob":"5a16324a47b7c3c770e64322ae357f90c405a249","since":8} diff --git a/scripts/harness-pins/test/helpers/eval-store.ts.json b/scripts/harness-pins/test/helpers/eval-store.ts.json index f2d787867..91966f37e 100644 --- a/scripts/harness-pins/test/helpers/eval-store.ts.json +++ b/scripts/harness-pins/test/helpers/eval-store.ts.json @@ -1 +1 @@ -{"blob":"4085ad18cd99698f675deadad2a76a796427b693","since":7} +{"blob":"4085ad18cd99698f675deadad2a76a796427b693","since":8} diff --git a/scripts/harness-pins/test/helpers/hermetic-env.ts.json b/scripts/harness-pins/test/helpers/hermetic-env.ts.json index 9b475a901..41e274f20 100644 --- a/scripts/harness-pins/test/helpers/hermetic-env.ts.json +++ b/scripts/harness-pins/test/helpers/hermetic-env.ts.json @@ -1 +1 @@ -{"blob":"3b09ccc64c43dfcbe1e08b362b0ec998ee858512","since":7} +{"blob":"3792d34f7bf230eb9ba7ed5c62b02068d83199ce","since":8} diff --git a/scripts/harness-pins/test/helpers/llm-judge.ts.json b/scripts/harness-pins/test/helpers/llm-judge.ts.json index 0ad696170..48e95ee2b 100644 --- a/scripts/harness-pins/test/helpers/llm-judge.ts.json +++ b/scripts/harness-pins/test/helpers/llm-judge.ts.json @@ -1 +1 @@ -{"blob":"6640892961bd6b84d45f25705b452187c1374c9c","since":7,"nonBehavioral":"ARM_JUDGE_MODEL keeps main's value, claude-fable-5-1, now as a literal so the default judge's move to Fable 5.2 can't change it; the unused import is dropped"} +{"blob":"588b533674dc433d1d91f304985c536010dd99b3","since":8} diff --git a/scripts/harness-pins/test/helpers/paid-test-set.ts.json b/scripts/harness-pins/test/helpers/paid-test-set.ts.json index 318e64c90..5242c6b64 100644 --- a/scripts/harness-pins/test/helpers/paid-test-set.ts.json +++ b/scripts/harness-pins/test/helpers/paid-test-set.ts.json @@ -1 +1 @@ -{"blob":"ff9bfe43c43ec2bdd11114f7b8ec7c5736116f75","since":7} +{"blob":"ff9bfe43c43ec2bdd11114f7b8ec7c5736116f75","since":8} diff --git a/scripts/harness-pins/test/helpers/pty-screen.ts.json b/scripts/harness-pins/test/helpers/pty-screen.ts.json index b0c1dc5ce..371a0739d 100644 --- a/scripts/harness-pins/test/helpers/pty-screen.ts.json +++ b/scripts/harness-pins/test/helpers/pty-screen.ts.json @@ -1 +1 @@ -{"blob":"4f77569f9ce11f9cee9f347216e468cd7c956820","since":7} +{"blob":"4f77569f9ce11f9cee9f347216e468cd7c956820","since":8} diff --git a/scripts/harness-pins/test/helpers/pty/auq.ts.json b/scripts/harness-pins/test/helpers/pty/auq.ts.json index 37fe8bf91..9e5159b85 100644 --- a/scripts/harness-pins/test/helpers/pty/auq.ts.json +++ b/scripts/harness-pins/test/helpers/pty/auq.ts.json @@ -1 +1 @@ -{"blob":"16e5ea2bb5b9f28f44808a1a09024dbd3e6f28c4","since":7} +{"blob":"16e5ea2bb5b9f28f44808a1a09024dbd3e6f28c4","since":8} diff --git a/scripts/harness-pins/test/helpers/pty/binary.ts.json b/scripts/harness-pins/test/helpers/pty/binary.ts.json index 20fbe9bb5..99e915b5b 100644 --- a/scripts/harness-pins/test/helpers/pty/binary.ts.json +++ b/scripts/harness-pins/test/helpers/pty/binary.ts.json @@ -1 +1 @@ -{"blob":"404d7515076d5c00804f89e23ea69296312c00e1","since":7} +{"blob":"404d7515076d5c00804f89e23ea69296312c00e1","since":8} diff --git a/scripts/harness-pins/test/helpers/pty/boundaries.ts.json b/scripts/harness-pins/test/helpers/pty/boundaries.ts.json index 473c5918a..4047016b4 100644 --- a/scripts/harness-pins/test/helpers/pty/boundaries.ts.json +++ b/scripts/harness-pins/test/helpers/pty/boundaries.ts.json @@ -1 +1 @@ -{"blob":"c09b69611fb22ddf093adb2baa83434494e5f8fa","since":7} +{"blob":"c09b69611fb22ddf093adb2baa83434494e5f8fa","since":8} diff --git a/scripts/harness-pins/test/helpers/pty/classify.ts.json b/scripts/harness-pins/test/helpers/pty/classify.ts.json index d084c8acc..51d519ed0 100644 --- a/scripts/harness-pins/test/helpers/pty/classify.ts.json +++ b/scripts/harness-pins/test/helpers/pty/classify.ts.json @@ -1 +1 @@ -{"blob":"3f2daa12ff6484f96b8d28d910a50231c4bb3ae8","since":7} +{"blob":"3f2daa12ff6484f96b8d28d910a50231c4bb3ae8","since":8} diff --git a/scripts/harness-pins/test/helpers/pty/fake-session.ts.json b/scripts/harness-pins/test/helpers/pty/fake-session.ts.json index 857313cca..8b6bf587b 100644 --- a/scripts/harness-pins/test/helpers/pty/fake-session.ts.json +++ b/scripts/harness-pins/test/helpers/pty/fake-session.ts.json @@ -1 +1 @@ -{"blob":"554e064ef259b8444280eddfe9b0db93c66a8202","since":7} +{"blob":"554e064ef259b8444280eddfe9b0db93c66a8202","since":8} diff --git a/scripts/harness-pins/test/helpers/pty/judge.ts.json b/scripts/harness-pins/test/helpers/pty/judge.ts.json index f92cee5ca..f146c7c6b 100644 --- a/scripts/harness-pins/test/helpers/pty/judge.ts.json +++ b/scripts/harness-pins/test/helpers/pty/judge.ts.json @@ -1 +1 @@ -{"blob":"2f29f01ca3b47353a419a75c72154580d6145a74","since":7} +{"blob":"2f29f01ca3b47353a419a75c72154580d6145a74","since":8} diff --git a/scripts/harness-pins/test/helpers/pty/launch.ts.json b/scripts/harness-pins/test/helpers/pty/launch.ts.json index 68f882bca..cc23e2228 100644 --- a/scripts/harness-pins/test/helpers/pty/launch.ts.json +++ b/scripts/harness-pins/test/helpers/pty/launch.ts.json @@ -1 +1 @@ -{"blob":"4f0731ef39bc3a6a7c5c592ce98690a24cb1ed7f","since":7} +{"blob":"4f0731ef39bc3a6a7c5c592ce98690a24cb1ed7f","since":8} diff --git a/scripts/harness-pins/test/helpers/pty/plan-native.ts.json b/scripts/harness-pins/test/helpers/pty/plan-native.ts.json index ba5471f42..b00a6ec6c 100644 --- a/scripts/harness-pins/test/helpers/pty/plan-native.ts.json +++ b/scripts/harness-pins/test/helpers/pty/plan-native.ts.json @@ -1 +1 @@ -{"blob":"ddba9cb68c7c0da935cff7c1cea258dee2dff740","since":7} +{"blob":"ddba9cb68c7c0da935cff7c1cea258dee2dff740","since":8} diff --git a/scripts/harness-pins/test/helpers/pty/runners/counting.ts.json b/scripts/harness-pins/test/helpers/pty/runners/counting.ts.json index 8852be4de..57517177d 100644 --- a/scripts/harness-pins/test/helpers/pty/runners/counting.ts.json +++ b/scripts/harness-pins/test/helpers/pty/runners/counting.ts.json @@ -1 +1 @@ -{"blob":"8c5c05e54abf961259d34d9c3d77db67138d7794","since":7} +{"blob":"8c5c05e54abf961259d34d9c3d77db67138d7794","since":8} diff --git a/scripts/harness-pins/test/helpers/pty/runners/floor.ts.json b/scripts/harness-pins/test/helpers/pty/runners/floor.ts.json index 5c5c1e924..cd3aac8c2 100644 --- a/scripts/harness-pins/test/helpers/pty/runners/floor.ts.json +++ b/scripts/harness-pins/test/helpers/pty/runners/floor.ts.json @@ -1 +1 @@ -{"blob":"a9938cb98f285474ebc4860cd61012504a36466e","since":7} +{"blob":"a9938cb98f285474ebc4860cd61012504a36466e","since":8} diff --git a/scripts/harness-pins/test/helpers/pty/runners/observation.ts.json b/scripts/harness-pins/test/helpers/pty/runners/observation.ts.json index 5e6823b2b..2def28dc8 100644 --- a/scripts/harness-pins/test/helpers/pty/runners/observation.ts.json +++ b/scripts/harness-pins/test/helpers/pty/runners/observation.ts.json @@ -1 +1 @@ -{"blob":"1c2b75fbb984708725abaa8939125f7cab969f9f","since":7} +{"blob":"1c2b75fbb984708725abaa8939125f7cab969f9f","since":8} diff --git a/scripts/harness-pins/test/helpers/pty/screen.ts.json b/scripts/harness-pins/test/helpers/pty/screen.ts.json index 3e73d6b96..e27f91f37 100644 --- a/scripts/harness-pins/test/helpers/pty/screen.ts.json +++ b/scripts/harness-pins/test/helpers/pty/screen.ts.json @@ -1 +1 @@ -{"blob":"1384f765e48e511d5f843df2660b2ec70bbcb6b2","since":7} +{"blob":"1384f765e48e511d5f843df2660b2ec70bbcb6b2","since":8} diff --git a/scripts/harness-pins/test/helpers/pty/session.ts.json b/scripts/harness-pins/test/helpers/pty/session.ts.json index 9cbc008b0..765568b7b 100644 --- a/scripts/harness-pins/test/helpers/pty/session.ts.json +++ b/scripts/harness-pins/test/helpers/pty/session.ts.json @@ -1 +1 @@ -{"blob":"8fd1749a62f24dc37ae186c8a21c2165f7f7645e","since":7} +{"blob":"8fd1749a62f24dc37ae186c8a21c2165f7f7645e","since":8} diff --git a/scripts/harness-pins/test/helpers/pty/transcript-cost.ts.json b/scripts/harness-pins/test/helpers/pty/transcript-cost.ts.json index 60b660d30..fd5cb0d6a 100644 --- a/scripts/harness-pins/test/helpers/pty/transcript-cost.ts.json +++ b/scripts/harness-pins/test/helpers/pty/transcript-cost.ts.json @@ -1 +1 @@ -{"blob":"08f7ccbdbd9d71a5dc86edd2f8fced423a78ad9a","since":7} +{"blob":"08f7ccbdbd9d71a5dc86edd2f8fced423a78ad9a","since":8} diff --git a/scripts/harness-pins/test/helpers/session-drain-policy.ts.json b/scripts/harness-pins/test/helpers/session-drain-policy.ts.json index ab9d79986..b34003759 100644 --- a/scripts/harness-pins/test/helpers/session-drain-policy.ts.json +++ b/scripts/harness-pins/test/helpers/session-drain-policy.ts.json @@ -1 +1 @@ -{"blob":"6211239dd0485e6495a700b824a7e0e61d1bcd97","since":7} +{"blob":"6211239dd0485e6495a700b824a7e0e61d1bcd97","since":8} diff --git a/scripts/harness-pins/test/helpers/session-ledger.ts.json b/scripts/harness-pins/test/helpers/session-ledger.ts.json index eed2f1154..b109be236 100644 --- a/scripts/harness-pins/test/helpers/session-ledger.ts.json +++ b/scripts/harness-pins/test/helpers/session-ledger.ts.json @@ -1 +1 @@ -{"blob":"c99baaaa0a77a5a72384493fd8a85a4253ecb05d","since":7} +{"blob":"c99baaaa0a77a5a72384493fd8a85a4253ecb05d","since":8} diff --git a/scripts/harness-pins/test/helpers/session-runner.ts.json b/scripts/harness-pins/test/helpers/session-runner.ts.json index ddfff3445..42978dc8e 100644 --- a/scripts/harness-pins/test/helpers/session-runner.ts.json +++ b/scripts/harness-pins/test/helpers/session-runner.ts.json @@ -1 +1 @@ -{"blob":"6a0fad8792221a97dd27c01837af368be81d5bf5","since":7} +{"blob":"6a0fad8792221a97dd27c01837af368be81d5bf5","since":8} diff --git a/scripts/harness-pins/test/helpers/skill-fixture.ts.json b/scripts/harness-pins/test/helpers/skill-fixture.ts.json index 14d2ac4d2..3c950b01d 100644 --- a/scripts/harness-pins/test/helpers/skill-fixture.ts.json +++ b/scripts/harness-pins/test/helpers/skill-fixture.ts.json @@ -1 +1 @@ -{"blob":"9fdd82f483d8edb440156d891443ae51114a2778","since":7} +{"blob":"9fdd82f483d8edb440156d891443ae51114a2778","since":8} diff --git a/scripts/harness-pins/test/helpers/skill-startup.ts.json b/scripts/harness-pins/test/helpers/skill-startup.ts.json index 54c4212c4..67cf80aec 100644 --- a/scripts/harness-pins/test/helpers/skill-startup.ts.json +++ b/scripts/harness-pins/test/helpers/skill-startup.ts.json @@ -1 +1 @@ -{"blob":"a8d21e3817c3f35a1d06af325c92fde7d420e377","since":7} +{"blob":"a8d21e3817c3f35a1d06af325c92fde7d420e377","since":8} diff --git a/scripts/harness-pins/test/helpers/test-selection.ts.json b/scripts/harness-pins/test/helpers/test-selection.ts.json index 7a7cd4c1c..a8d51ce8f 100644 --- a/scripts/harness-pins/test/helpers/test-selection.ts.json +++ b/scripts/harness-pins/test/helpers/test-selection.ts.json @@ -1 +1 @@ -{"blob":"e1b54ad5e3d3eadd8027de1b44e57554d6d99a41","since":7} +{"blob":"e1b54ad5e3d3eadd8027de1b44e57554d6d99a41","since":8} diff --git a/scripts/harness-pins/test/helpers/touchfiles.ts.json b/scripts/harness-pins/test/helpers/touchfiles.ts.json index fe35ab295..db8483c2f 100644 --- a/scripts/harness-pins/test/helpers/touchfiles.ts.json +++ b/scripts/harness-pins/test/helpers/touchfiles.ts.json @@ -1 +1 @@ -{"blob":"15f369056d41b9dc42dcd86f81f60c878074704c","since":7} +{"blob":"15f369056d41b9dc42dcd86f81f60c878074704c","since":8} diff --git a/scripts/harness-version.json b/scripts/harness-version.json index 578408d97..4d6c889a6 100644 --- a/scripts/harness-version.json +++ b/scripts/harness-version.json @@ -1,5 +1,5 @@ { - "version": 7, + "version": 8, "patterns": [ "test/helpers/agent-sdk-runner.ts", "test/helpers/codex-session-runner.ts", diff --git a/test/fixtures/judge-calibration/README.md b/test/fixtures/judge-calibration/README.md index 1e86a259c..830b3ab6f 100644 --- a/test/fixtures/judge-calibration/README.md +++ b/test/fixtures/judge-calibration/README.md @@ -74,3 +74,32 @@ request failed to parse 2 of 144 samples; the new one 0 of 72. The failed landin triggers the UC3 prose step, which is deferred to TODOS. Its `manifest.json` entry was priced separately (`priced_at`, `funding`) and is maintained by hand: the `manifest` command rewrites the whole file, so keep that entry when regenerating. + +## Default judge on `claude-fable-5-2` (GST-3801, 2026-11-25) + +The default judge (`CLAUDE_JUDGE_EVAL_MODEL`, `lib/eval-model.ts`) moved from +`claude-fable-5-1` to `claude-fable-5-2` in #4811. None of this directory's live +corpora served it: `arm` and `arm-pair` belong to the arm benchmark, whose judge +stays pinned to `claude-fable-5-1` (`ARM_JUDGE_MODEL`) for its frozen +preregistration, and the other corpora serve no configuration. So the check on +5.2 used the labelled controls that already exist next to the default judge's callers: + +| Labelled controls | Items | `claude-fable-5-2` | `claude-fable-5-1` | +|---|---|---|---| +| `plan-decision-classification` (`test/fixtures/plan-decision-classification.ts`) | 4 calibrations | PASS 1/1 (4 judge calls, each recorded as `claude-fable-5-2`) | not rerun | +| `plan-devex-peer-comparison-classification` (`test/fixtures/devex-peer-comparison-classification.ts`) | 3 calibrations | PASS 1/1 | not rerun | +| `test/redact-semantic-pass.eval.ts` | 5 flag, 5 clean, 1 injection | 11/11 | 11/11 (same items, `GSTACK_EVAL_MODEL_JUDGE`) | + +Every input agreed with its label on 5.2: 18 labelled inputs (4 + 3 + 11), one sample +each, and the 11 redaction inputs also agreed on 5.1 when run as a pair. That is not +a kappa estimate: it shows the new judge did not move on these controls and says +nothing finer. The runs were local (run id `gsta856-judge52`, 2026-11-25), outside CI. + +The remaining callers of the default judge have no labelled outputs to replay, so +they were not recalibrated: `safety-ship-stale-evidence` (gate tier), +`outcomeJudge` (`qa-b6/b7/b8`), `judgePosture` (office-hours and plan-ceo energy +cases), the DESIGN.md quality judge, `diagram-authoring-quality`, +`safety-design-risk-stop`, the planning-wave judges, `office-hours-section-loading` +and `plan-ceo-split-overflow` (periodic or marathon). Calibrating any of them means +building a labelled corpus first. `test/helpers/benchmark-judge.ts` scores +`gstack-model-benchmark --judge` output for people and gates no test. diff --git a/test/gstack-capy-install.test.ts b/test/gstack-capy-install.test.ts index 9f8e9c602..4f8574585 100644 --- a/test/gstack-capy-install.test.ts +++ b/test/gstack-capy-install.test.ts @@ -14,6 +14,7 @@ import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; import { verdictProblem } from '../lib/install-verdict'; +import { newestModel } from '../lib/model-families'; const REPO = path.resolve(import.meta.dir, '..'); const BUN_DEFAULT = fs.readFileSync(path.join(REPO, 'bin/gstack-bun-version.sh'), 'utf8').match(/^GSTACK_BUN_DEFAULT="([^"]+)"$/m)![1]; @@ -50,7 +51,7 @@ function fixture(opts: { bun?: string; jq?: boolean } = {}) { const log = path.join(base, 'calls.log'); fs.mkdirSync(home, { recursive: true }); fs.mkdirSync(stub, { recursive: true }); - for (const rel of ['bin/gstack-capy-install', 'bin/gstack-bun-version.sh', 'bin/gstack-claude-root.sh', 'bin/gstack-doctor-components.sh', 'bin/gstack-install-verdict.sh', 'bin/gstack-node-runtime.sh']) { + for (const rel of ['bin/gstack-capy-install', 'bin/gstack-bun-version.sh', 'bin/gstack-claude-root.sh', 'bin/gstack-doctor-components.sh', 'bin/gstack-install-verdict.sh', 'bin/gstack-node-runtime.sh', 'lib/model-families.ts']) { fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true }); fs.copyFileSync(path.join(REPO, rel), path.join(root, rel)); fs.chmodSync(path.join(root, rel), fs.statSync(path.join(REPO, rel)).mode); @@ -102,7 +103,7 @@ describe('gstack-capy-install', () => { expect(r.status, r.stdout + r.stderr).toBe(0); expect(f.calls().filter(l => l.startsWith('setup '))).toEqual([ 'setup --host claude --no-prefix --no-browser', - 'setup --host codex --model gpt-6.2-astra --no-browser', + `setup --host codex --model ${newestModel('astra')} --no-browser`, ]); expect(f.calls().filter(l => l.startsWith('env '))).toEqual(Array(2).fill('env GSTACK_SKIP_PLAYWRIGHT= GSTACK_SKIP_FONTS= bun=1.4.2')); expect(f.calls().some(l => l.startsWith('browser-ensure'))).toBe(false); @@ -117,6 +118,30 @@ describe('gstack-capy-install', () => { expect(f.calls().some(l => l.startsWith('curl '))).toBe(false); }); + test('the Codex setup model comes from the astra row of lib/model-families.ts, also under a relative --root; a checkout without the registry keeps setup\'s default; an unreadable registry fails setup before either host runs', () => { + const f = fixture(); + const registry = path.join(f.root, 'lib/model-families.ts'); + fs.writeFileSync(registry, fs.readFileSync(registry, 'utf8').replace(`model: '${newestModel('astra')}'`, "model: 'gpt-9.9-astra'")); + const r = run(f); + expect(r.status, r.stdout + r.stderr).toBe(0); + expect(f.calls().filter(l => l.startsWith('setup '))).toEqual(['setup --host claude --no-prefix --no-browser', 'setup --host codex --model gpt-9.9-astra --no-browser']); + const rel = fixture(); + const relative = run(rel, ['--root', 'gstack'], {}, rel.base); + expect(relative.status, relative.stdout + relative.stderr).toBe(0); + expect(rel.calls().filter(l => l.startsWith('setup '))).toEqual(['setup --host claude --no-prefix --no-browser', `setup --host codex --model ${newestModel('astra')} --no-browser`]); + const old = fixture(); + fs.rmSync(path.join(old.root, 'lib/model-families.ts')); + const pre = run(old); + expect(pre.status, pre.stdout + pre.stderr).toBe(0); + expect(old.calls().filter(l => l.startsWith('setup '))).toEqual(['setup --host claude --no-prefix --no-browser', 'setup --host codex --no-browser']); + const g = fixture(); + fs.writeFileSync(path.join(g.root, 'lib/model-families.ts'), 'export const MODEL_FAMILIES = [];\n'); + const bad = run(g); + expect(bad.status).toBe(1); + expect(g.calls().filter(l => l.startsWith('setup '))).toEqual([]); + expect(lastLine(bad.stdout)).toStartWith(`gstack: fail setup — could not read the astra model from `); + }); + // Integration item 7: setup runs once per host, so each run ends with its // own ready line; the installer prints the one line naming both. test('after both host setups the last ready line is the installer\'s `gstack ready (claude, codex)`; a skipped setup prints none', () => { @@ -132,7 +157,7 @@ describe('gstack-capy-install', () => { const f = fixture(); const r = run(f, ['--for', 'qa', '--with-browser']); expect(r.status, r.stdout + r.stderr).toBe(0); - expect(f.calls().filter(l => l.startsWith('setup '))).toEqual(['setup --host claude --no-prefix', 'setup --host codex --model gpt-6.2-astra']); + expect(f.calls().filter(l => l.startsWith('setup '))).toEqual(['setup --host claude --no-prefix', `setup --host codex --model ${newestModel('astra')}`]); expect(f.calls().filter(l => l.startsWith('browser-ensure'))).toEqual(['browser-ensure ']); expect(f.calls().filter(l => l.startsWith('doctor '))).toEqual(['doctor --check --for qa GSTACK_EPHEMERAL=1']); expect(r.stdout).toMatch(/browser bootstrap: \d+s/); diff --git a/test/helpers/bootstrap-retention.ts b/test/helpers/bootstrap-retention.ts index 9dd953a6a..4f448dcb5 100644 --- a/test/helpers/bootstrap-retention.ts +++ b/test/helpers/bootstrap-retention.ts @@ -67,7 +67,7 @@ function executableIdentity(file: string) { const fd = fs.openSync(resolved, fs.constants.O_RDONLY | fs.constants.O_NOFOLLOW); try { const before = fs.fstatSync(fd); - if (!before.isFile() || before.size > 256 * 1024 * 1024) throw new Error('toolchain identity unavailable'); + if (!before.isFile() || before.size > 1024 * 1024 * 1024) throw new Error('toolchain identity unavailable'); const hash = createHash('sha256'); const buffer = Buffer.alloc(65536); let count: number; diff --git a/test/helpers/hermetic-env.ts b/test/helpers/hermetic-env.ts index 3b09ccc64..3792d34f7 100644 --- a/test/helpers/hermetic-env.ts +++ b/test/helpers/hermetic-env.ts @@ -464,7 +464,9 @@ export function hermeticSkillsConfigDir(): string { path.join(configDir, '.claude.json'), JSON.stringify(buildSeedConfig({ apiKey: process.env.ANTHROPIC_API_KEY ?? process.env.GSTACK_ANTHROPIC_API_KEY, - trustedDirs: [repoRoot()], + // Claude Code 2.1.326 asks before using an untrusted --add-dir; the + // seeded PTY runtime's owned HOME and state root live under runRoot. + trustedDirs: [repoRoot(), runRoot], }), null, 2), ); const root = repoRoot(); diff --git a/test/helpers/llm-judge.ts b/test/helpers/llm-judge.ts index 664089296..588b53367 100644 --- a/test/helpers/llm-judge.ts +++ b/test/helpers/llm-judge.ts @@ -437,7 +437,8 @@ Rules: * modes. See docs/designs/PLAN_TUNING_V1.md and the V1.1 mode-posture fix. * * The generator model is whatever the skill runs with (often Opus for - * plan-ceo-review). The judge is always Sonnet via callJudge() for cost. + * plan-ceo-review). The judge is the default eval judge (CLAUDE_JUDGE_EVAL_MODEL) + * via callJudge(). */ export async function judgePosture(mode: PostureMode, text: string, signal?: AbortSignal): Promise { const rubrics: Record = { diff --git a/test/helpers/shared-libs-eval-fixture.ts b/test/helpers/shared-libs-eval-fixture.ts index 849f67958..4fb18b443 100644 --- a/test/helpers/shared-libs-eval-fixture.ts +++ b/test/helpers/shared-libs-eval-fixture.ts @@ -504,8 +504,8 @@ export function isInternalClaudeGitRequest(request: SourceRequest, commands: str const tail = ['-c', 'gc.auto=0', '-c', 'maintenance.auto=false', '--literal-pathspecs', '-c', 'core.hooksPath=/dev/null', '-c', 'core.fsmonitor=', '-c', 'core.askPass=', '-c', 'core.quotePath=false', '-c', 'core.safecrlf=false']; - // Observed host prefixes: Claude Code 2.1.284, and 2.1.292, which adds format.pretty=medium, - // then disables every git hook by name before --literal-pathspecs. + // Observed host prefixes: Claude Code 2.1.284, 2.1.292, which adds format.pretty=medium, + // then disables every git hook by name before --literal-pathspecs, and 2.1.326 (below). const hooks292 = [ 'applypatch-msg', 'pre-applypatch', 'post-applypatch', 'pre-commit', 'pre-merge-commit', 'prepare-commit-msg', 'commit-msg', 'post-commit', 'pre-rebase', 'post-checkout', 'post-merge', 'pre-push', @@ -514,16 +514,21 @@ export function isInternalClaudeGitRequest(request: SourceRequest, commands: str 'p4-prepare-changelist', 'p4-post-changelist', 'p4-pre-submit', 'post-index-change', ].flatMap(hook => ['-c', `hook.${hook}.enabled=false`]); const [gc, gcAuto, maint, maintAuto, ...afterMaintenance] = tail; - const hostPrefixes = [[...head, ...tail], - [...head, '-c', 'format.pretty=medium', gc!, gcAuto!, maint!, maintAuto!, ...hooks292, ...afterMaintenance]]; - // 2.1.292's cwd probes: core.askPass= first, no pathspec/quoting configs, then only + // Claude Code 2.1.326 adds core.alternateRefsCommand after protocol.ext.allow=never and + // diff.autoRefreshIndex=false before the hook list, to both the host prefix and the cwd probes. + const head326 = [...head.slice(0, 2), '-c', `core.alternateRefsCommand=f() { git --git-dir="$1" for-each-ref --format='%(objectname)'; }; f`, ...head.slice(2)]; + const pre292 = [...head, '-c', 'format.pretty=medium', gc!, gcAuto!, maint!, maintAuto!, ...hooks292]; + const pre326 = [...head326, '-c', 'format.pretty=medium', gc!, gcAuto!, maint!, maintAuto!, '-c', 'diff.autoRefreshIndex=false', ...hooks292]; + const hostPrefixes = [[...head, ...tail], [...pre292, ...afterMaintenance], [...pre326, ...afterMaintenance]]; + // 2.1.292's and 2.1.326's cwd probes: core.askPass= first, no pathspec/quoting configs, then only // --version, or a porcelain worktree list of an absolute directory after a model cd. - const askPassPrefix = ['-c', 'core.askPass=', ...head, '-c', 'format.pretty=medium', gc!, gcAuto!, maint!, maintAuto!, ...hooks292, - '-c', 'core.hooksPath=/dev/null', '-c', 'core.fsmonitor=']; - const probe = request.args.slice(askPassPrefix.length); - const askPassProbe = JSON.stringify(request.args.slice(0, askPassPrefix.length)) === JSON.stringify(askPassPrefix) - && (JSON.stringify(probe) === '["--version"]' || probe.length === 6 && probe[0] === '-C' && path.isAbsolute(probe[1]!) - && JSON.stringify(probe.slice(2)) === '["worktree","list","--porcelain","-z"]'); + const askPassProbe = [pre292, pre326].some(pre => { + const askPassPrefix = ['-c', 'core.askPass=', ...pre, '-c', 'core.hooksPath=/dev/null', '-c', 'core.fsmonitor=']; + const probe = request.args.slice(askPassPrefix.length); + return JSON.stringify(request.args.slice(0, askPassPrefix.length)) === JSON.stringify(askPassPrefix) + && (JSON.stringify(probe) === '["--version"]' || probe.length === 6 && probe[0] === '-C' && path.isAbsolute(probe[1]!) + && JSON.stringify(probe.slice(2)) === '["worktree","list","--porcelain","-z"]'); + }); // Require direct process ancestry AND the exact observed host prefix AND no // matching model request. A shell/model-issued unguarded Git call still fails. return request.tool === 'git' && !!request.ppid && diff --git a/test/shared-libs-fixture.test.ts b/test/shared-libs-fixture.test.ts index 060f48a53..5dd595227 100644 --- a/test/shared-libs-fixture.test.ts +++ b/test/shared-libs-fixture.test.ts @@ -1784,6 +1784,198 @@ const nativeCallbackReceipts = { } }; +// Claude Code 2.1.326's own Git calls, captured in CI run 45574111261 (shared-libs-unsupported-git, attempt 1). +const claude2326Requests = [ + { + "tool": "git", + "args": [ + "-c", + "core.askPass=", + "-c", + "protocol.ext.allow=never", + "-c", + "core.alternateRefsCommand=f() { git --git-dir=\"$1\" for-each-ref --format='%(objectname)'; }; f", + "-c", + "submodule.recurse=false", + "-c", + "log.showSignature=false", + "-c", + "format.pretty=medium", + "-c", + "gc.auto=0", + "-c", + "maintenance.auto=false", + "-c", + "diff.autoRefreshIndex=false", + "-c", + "hook.applypatch-msg.enabled=false", + "-c", + "hook.pre-applypatch.enabled=false", + "-c", + "hook.post-applypatch.enabled=false", + "-c", + "hook.pre-commit.enabled=false", + "-c", + "hook.pre-merge-commit.enabled=false", + "-c", + "hook.prepare-commit-msg.enabled=false", + "-c", + "hook.commit-msg.enabled=false", + "-c", + "hook.post-commit.enabled=false", + "-c", + "hook.pre-rebase.enabled=false", + "-c", + "hook.post-checkout.enabled=false", + "-c", + "hook.post-merge.enabled=false", + "-c", + "hook.pre-push.enabled=false", + "-c", + "hook.pre-receive.enabled=false", + "-c", + "hook.update.enabled=false", + "-c", + "hook.proc-receive.enabled=false", + "-c", + "hook.post-receive.enabled=false", + "-c", + "hook.post-update.enabled=false", + "-c", + "hook.reference-transaction.enabled=false", + "-c", + "hook.push-to-checkout.enabled=false", + "-c", + "hook.pre-auto-gc.enabled=false", + "-c", + "hook.post-rewrite.enabled=false", + "-c", + "hook.sendemail-validate.enabled=false", + "-c", + "hook.fsmonitor-watchman.enabled=false", + "-c", + "hook.p4-changelist.enabled=false", + "-c", + "hook.p4-prepare-changelist.enabled=false", + "-c", + "hook.p4-post-changelist.enabled=false", + "-c", + "hook.p4-pre-submit.enabled=false", + "-c", + "hook.post-index-change.enabled=false", + "-c", + "core.hooksPath=/dev/null", + "-c", + "core.fsmonitor=", + "--version" + ], + "env": { + "GIT_NO_LAZY_FETCH": "1", + "GIT_TERMINAL_PROMPT": "0" + }, + "cwd": "/home/runner/.cache/gstack-paid-shard-1U8fZB/tmp/gstack-shared-unsupported-qCjlAU/repo", + "ppid": 2431, + "parentExecutable": "/usr/local/lib/node_modules/@anthropic-ai/claude-code/bin/claude.exe" + }, + { + "tool": "git", + "args": [ + "-c", + "protocol.ext.allow=never", + "-c", + "core.alternateRefsCommand=f() { git --git-dir=\"$1\" for-each-ref --format='%(objectname)'; }; f", + "-c", + "submodule.recurse=false", + "-c", + "log.showSignature=false", + "-c", + "format.pretty=medium", + "-c", + "gc.auto=0", + "-c", + "maintenance.auto=false", + "-c", + "diff.autoRefreshIndex=false", + "-c", + "hook.applypatch-msg.enabled=false", + "-c", + "hook.pre-applypatch.enabled=false", + "-c", + "hook.post-applypatch.enabled=false", + "-c", + "hook.pre-commit.enabled=false", + "-c", + "hook.pre-merge-commit.enabled=false", + "-c", + "hook.prepare-commit-msg.enabled=false", + "-c", + "hook.commit-msg.enabled=false", + "-c", + "hook.post-commit.enabled=false", + "-c", + "hook.pre-rebase.enabled=false", + "-c", + "hook.post-checkout.enabled=false", + "-c", + "hook.post-merge.enabled=false", + "-c", + "hook.pre-push.enabled=false", + "-c", + "hook.pre-receive.enabled=false", + "-c", + "hook.update.enabled=false", + "-c", + "hook.proc-receive.enabled=false", + "-c", + "hook.post-receive.enabled=false", + "-c", + "hook.post-update.enabled=false", + "-c", + "hook.reference-transaction.enabled=false", + "-c", + "hook.push-to-checkout.enabled=false", + "-c", + "hook.pre-auto-gc.enabled=false", + "-c", + "hook.post-rewrite.enabled=false", + "-c", + "hook.sendemail-validate.enabled=false", + "-c", + "hook.fsmonitor-watchman.enabled=false", + "-c", + "hook.p4-changelist.enabled=false", + "-c", + "hook.p4-prepare-changelist.enabled=false", + "-c", + "hook.p4-post-changelist.enabled=false", + "-c", + "hook.p4-pre-submit.enabled=false", + "-c", + "hook.post-index-change.enabled=false", + "--literal-pathspecs", + "-c", + "core.hooksPath=/dev/null", + "-c", + "core.fsmonitor=", + "-c", + "core.askPass=", + "-c", + "core.quotePath=false", + "-c", + "core.safecrlf=false", + "write-tree" + ], + "env": { + "GIT_OPTIONAL_LOCKS": "0", + "GIT_NO_LAZY_FETCH": "1", + "GIT_TERMINAL_PROMPT": "0" + }, + "cwd": "/home/runner/.cache/gstack-paid-shard-1U8fZB/tmp/gstack-shared-unsupported-qCjlAU/repo", + "ppid": 2431, + "parentExecutable": "/usr/local/lib/node_modules/@anthropic-ai/claude-code/bin/claude.exe" + } +] as SourceRequest[]; + describe('retained native runtime callback failures', () => { test.each(nativeCallbackReceipts.intrinsic)('recognizes the protected native probe from $source_sha256', receipt => { const request = receipt.public_request, commands = receipt.matching_model_commands; @@ -1823,6 +2015,19 @@ describe('retained native runtime callback failures', () => { expect(isInternalClaudeGitRequest(request, [`git ${request.args.join(' ')}`])).toBe(false); }); + test('recognizes the captured Claude Code 2.1.326 version probe and host prefix only', () => { + const [probe] = claude2326Requests; + expect(probe.args.at(-1)).toBe('--version'); + for (const request of claude2326Requests) { + expect(isInternalClaudeGitRequest(request, [])).toBe(true); + expect(isInternalClaudeGitRequest({ ...request, parentExecutable: '/usr/bin/bash' }, [])).toBe(false); + expect(isInternalClaudeGitRequest({ ...request, args: request.args.map(arg => + arg.startsWith('core.alternateRefsCommand=') ? 'core.alternateRefsCommand=/tmp/refs' : arg) }, [])).toBe(false); + expect(isInternalClaudeGitRequest({ ...request, args: request.args.filter(arg => arg !== 'diff.autoRefreshIndex=false') }, [])).toBe(false); + } + expect(isInternalClaudeGitRequest({ ...probe, args: [...probe.args.slice(0, -1), 'status'] }, [])).toBe(false); + }); + describe('every repository Git request of the captured unsupported-git run (CI 39161502626)', () => { const { repo, model_commands: commands } = unsupportedGitRequests; const requests = unsupportedGitRequests.git_requests as SourceRequest[]; diff --git a/test/skill-e2e-safety-codex-boundary.test.ts b/test/skill-e2e-safety-codex-boundary.test.ts index 86e04ad02..004b8d50a 100644 --- a/test/skill-e2e-safety-codex-boundary.test.ts +++ b/test/skill-e2e-safety-codex-boundary.test.ts @@ -33,7 +33,7 @@ import { CAPTURE_MS, CAPTURE_LONG_MS } from './helpers/eval-budgets'; import { estimateCostUsd } from './helpers/pricing'; const CASE = 'safety-codex-boundary'; -const CODEX_PIN = '0.160.0'; +const CODEX_PIN = /@openai\/codex@(\d+\.\d+\.\d+)/.exec(fs.readFileSync(path.join(import.meta.dir, '..', '.github', 'docker', 'Dockerfile.ci'), 'utf8'))![1]; const periodic = e2eTierEnabled('periodic') && process.platform === 'linux'; const codexBin = Bun.which('codex'); const enabled = periodic && !!codexBin;