Tests that copy their own bun no longer trip the review fetch check (GST-4112) (#4876)

A test that copies the host's own `bun` binary into a temp folder no
longer stops `/gstack-ship` with a fetch violation, and Codex prompt
files from `/plan-ceo-review` and `/plan-eng-review` can no longer be
committed by accident.

It keeps shipping runs from stopping for no reason and keeps scratch
files out of commits; the `/autoplan` guard now also treats Claude Code
2.1.326, the version CI runs, as checked.

Nothing to do after merge.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=testing
Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p2/outside-voice#2 reader=outside-voice
Review-Finding: p2/adversarial-native#3 reader=adversarial-native
Review-Finding: p2/outside-voice#3 reader=outside-voice
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-28 15:09:08 +00:00
1 parent 44df37961b
commit dfbdccf4c1
15 files changed
+283 -23

No files matched your search

+16
View File
@@ -224,6 +224,21 @@ _gstack_codex_role_ready() {
return 0
}
_gstack_codex_exclude_scratch() {
# Plan reviews write their Codex prompt in the working directory's .gstack/tmp/
# (#4851). Keep that folder out of git through git's own exclude path, which a
# linked worktree shares with its main checkout. Idempotent; a no-op outside
# git, without the folder, or when .gstack or .gstack/tmp is a symlink.
local _ex _ig
[ -d .gstack/tmp ] && [ ! -L .gstack ] && [ ! -L .gstack/tmp ] || return 0
_ex=$(git rev-parse --git-path info/exclude 2>/dev/null) && [ -n "$_ex" ] || return 0
_ig="/$(git rev-parse --show-prefix 2>/dev/null | sed 's/[][*?\\]/\\&/g').gstack/tmp/"
grep -qsxF "$_ig" "$_ex" && return 0
mkdir -p "${_ex%/*}" 2>/dev/null || return 0
{ [ ! -s "$_ex" ] || [ -z "$(tail -c1 "$_ex")" ] || echo; printf '%s\n' "$_ig"; } >>"$_ex" 2>/dev/null
return 0
}
# --- Sandbox (B1) -----------------------------------------------------------
_gstack_codex_sandbox_mode() {
@@ -1002,6 +1017,7 @@ _gstack_codex_main() {
return "$_rc" ;;
role-ready)
_gstack_codex_role_args ready "$@" || { _gstack_codex_usage >&2; return 64; }
_gstack_codex_exclude_scratch
_gstack_codex_role_ready "$_GSTACK_CODEX_ARG_KIND" "$_GSTACK_CODEX_ARG_CWD" "$_GSTACK_CODEX_ARG_MODEL" >&2
_rc=$?
[ "$_rc" -eq 0 ] || return "$_rc"