Skip to content

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

Merged
capy-ai[bot] merged 4 commits into
mainfrom
maintenance-sweep-runtime-copy-and-tmp-exclude
Nov 28, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
maintenance-sweep-runtime-copy-and-tmp-exclude

Conversation

@garrytan

@garrytan garrytan commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

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.

What changed

docs/skills.md now says standalone /review always runs the second-model review when Codex is ready

docs/skills.md now says standalone /review always runs the second-model review when Codex is ready.

Before/after as text: docs/skills.md now says standalone /review always runs the second-model review when Codex is ready
+### Second-model review and Red Team
+
+Standalone `/review` always runs a Codex second-model review when Codex is ready or its check is inconclusive, through `gstack-outside-voice`, and always runs the Red Team pass when the diff is over 200 lines (a smaller diff can still get one when a specialist finds something critical). The end-of-skill check refuses to finish without both. If Codex isn't installed or reviews are turned off, that is recorded as a skip and the review still finishes; a skip the model just claims in its own words does not count.

Tests on gstack-evals#463 copy their own bun into /tmp/hm-hold-*/.bun/bin/bun, and the review fetch check counted that copy as a download and stopped the run. The check now ignores a new file of 100 MB or more only when it has exactly the size and SHA-256 of the runtime running the check (process.execPath), printing FETCH_IGNORED: … reason=host-runtime. A file named bun with one byte flipped or added, or a copy later swapped for other bytes, still counts. The runtime is hashed at most once per process, only after a size match, and never past the sweep deadline. The existing catch is unchanged; this adds an exemption on top of it.

Plan-review Codex prompt files sat in .gstack/tmp/, which nothing told git to ignore. gstack-codex-probe role-ready, which the plan-review Codex block already runs, now adds the working directory's .gstack/tmp/ to git's exclude file, found with git rev-parse --git-path info/exclude so a linked worktree uses its main checkout's file. It writes each line once, keeps an exclude file without a final newline intact, refuses a symlinked .gstack or .gstack/tmp, and does nothing outside git.

The /autoplan guard's CHECKED_CLAUDE_CODE moves from 2.1.292 to 2.1.326, backed by a new capture in test/fixtures/claude-agent-payload-2.1.326.json. The guard's drift comparison finds no drift: 2.1.326 still strips only run_in_background from the Agent payload. Tests that keep 2.1.292 as an input on purpose now have a comment saying so.

Why

"A test that copies bun stops my ship run" (gstack-evals#463) and stray prompt files near git add both cost people a stopped run or a risky commit. Now the copy passes, the prompt files stay out of git, and the guard stops calling the CI version unchecked.

Blast radius

The fetch check change touches only the decision for files that match the running binary byte for byte, so every other download is still caught; test/review-sweep.test.ts walks the flipped-byte, added-byte and swapped-copy paths (script ran). The exclude helper only appends to git's exclude file, never to .gitignore, and test/outside-prompt-file.test.ts runs it at the repository root, in a subdirectory, in a linked worktree and outside git (script ran).

Pre-Landing Review

Two full review rounds, then one read-only full review of the final code. Every finding at or above the blocking floor was fixed. One second-model note was ruled a disclosed note by the maintainer: the plan-review prompt is written before the helper adds the exclude, so a prompt from the very first run can still appear in git status; main never excludes it at all, so this PR narrows the gap. Four comment-only test edits after that review were also ruled notes.

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL bin/gstack-codex-probe:233 The symlink guard in _gstack_codex_exclude_scratch has no test.
  • INFORMATIONAL lib/review-sweep.ts:150 The past-deadline path of the host-runtime exemption has no test.
  • INFORMATIONAL sf-e7896b7264ee security finding, details recorded privately
Documentation

Status: current. The branch's own doc edits already match the code, so no edits were needed.

Scope: base 09e2f44 to head 7e7ee2e (13 files, 3 commits; nothing staged, unstaged or untracked). I read the changed docs, the source behind each changed claim, and the autoplan guard troubleshooting page.

Documentation health:

  • docs/review-policy.md: current. The host-runtime fetch exemption matches lib/review-sweep.ts.
  • docs/troubleshooting.md: current. Its FETCH_IGNORED list includes the runtime copy.
  • docs/skills.md: current. The /review second-model and Red Team text matches review/SKILL.md.tmpl.
  • docs/autoplan-guard-troubleshooting.md: current. It names no checked Claude Code version, so the bump to 2.1.326 left nothing stale.
  • changelog.d/maintenance-sweep-runtime-copy-and-tmp-exclude.md: reviewed, not edited.

Coverage debt: the .gstack/tmp git-exclude step in gstack-codex-probe role-ready has reference coverage only, in the changelog fragment and the code comment. No diagram drift was found.

Tests
  • Focused tests: test/review-sweep.test.ts, test/outside-prompt-file.test.ts, test/autoplan-publication-payload.test.ts, test/autoplan-schema-canary-compare.test.ts, test/autoplan-guard-reasons.test.ts: pass locally.
  • typecheck, typecheck:test, module-size ratchet, parity suite: pass locally.
  • Full free suite (bun run test): runs in CI at the pushed head.

The 2.1.326 capture ran the npm binary (registry signatures verified, installed with --ignore-scripts) headless against a local scripted Messages API stub, so it made no model call. Claude Code's own schema parse, PreToolUse payload and journal are real; the stub chose the tool calls. It does not cover interactive flush timing.

Agent notes

Refs GST-4112. The brief allowed the Codex prompt helper as the home for the exclude; it lives there because the plan-ceo-review prompt has 23 bytes of room under its size cap. Shared file outside the brief's owned list: bin/gstack-codex-probe (one function, one call). Paid spend: $0.

Approvals

Approved: yes (record r-153fa771c5f7). The full approval record stays private.
Plan: exempt: bug fixes with failing-first tests
Plan check: exempt bug fix

REVIEW_LOOP: passes=3 blocking_found=2 deferred=0 noted=8 fixed=5 scope=frozen open=1 ledgers_read=4 dispatches=12
Gate edits: none detected (17 listed, 10 read, 0 tagged)
Ruled note: bin/gstack-codex-probe:1020:outside-voice at 7e7ee2e ruled by GStack Minder (relayed from a private message) at 2026-11-28T14:35:51.743Z: the plan-review prompt is written before the Codex helper adds the git exclude; main never excludes it at all, so this PR strictly narrows the gap (approval a-b7ba5708495a)
Ruled note: edit:test/autoplan-guard-reasons.test.ts at f657010 ruled by GStack Minder (relayed from a private message) at 2026-11-28T14:49:38.743Z: comment-only pregate-literal markers on deliberate 2.1.292 test inputs (approval a-d7f03fb4080d)
Ruled note: edit:test/autoplan-publication-payload.test.ts at f657010 ruled by GStack Minder (relayed from a private message) at 2026-11-28T14:49:38.877Z: comment-only pregate-literal markers on deliberate 2.1.292 test inputs (approval a-94b6ae6c289d)
Ruled note: edit:test/autoplan-schema-canary-compare.test.ts at f657010 ruled by GStack Minder (relayed from a private message) at 2026-11-28T14:49:39.017Z: comment-only pregate-literal markers on deliberate 2.1.292 test inputs (approval a-288a9893e5ca)
Ruled note: edit:test/helpers/autoplan-guard-fixture.ts at f657010 ruled by GStack Minder (relayed from a private message) at 2026-11-28T14:49:39.149Z: comment-only pregate-literal markers on deliberate 2.1.292 test inputs (approval a-4018950e0944)

{
  "schema_version": 1,
  "pr": 4876,
  "head": "f65701071f452c7bed7f57ef20f7d16a667d848a",
  "version": "1.104.2.0",
  "base": "main",
  "gate": {
    "bun run test": {
      "pass": 1739,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "bun_run_test",
      "run": 46156594069,
      "attempt": 1,
      "tree": "26e2a04b53102d85b5df55e903890f832458a8f5"
    }
  ],
  "calls": 27,
  "session_kind": "unattended",
  "run": "ship-4876",
  "head_tree": "26e2a04b53102d85b5df55e903890f832458a8f5",
  "product_patch_id": "2cfa699b5c74e5298a26da6f2ccdc312f8710826",
  "gstack_version": "1.104.2.0",
  "review_depth": {
    "depth": "full",
    "class": "code",
    "runtime_lines": 65,
    "rules": "183e0616b381d889",
    "base": "44df37961bdad86e9e4cacf5c99b3c391f69266e",
    "registry": "44df37961bdad86e9e4cacf5c99b3c391f69266e",
    "gate_scan": {
      "tagged": 0,
      "head": "f65701071f452c7bed7f57ef20f7d16a667d848a"
    },
    "reasons": [
      "risk:security",
      "runtime=65"
    ],
    "risk": [
      "security"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @26e2a04b5310 (8 checks, current for f65701071f45)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/46156594069/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=26e2a04b5310 tests=38709 skipped=66 runs=46156594069/1 profiles=ci-reuse/free-tests heads=f65701071f45 base_moved=44df37961bda verified=2026-11-28T14:57:31.679Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CONTRIBUTING.md (changed: docs/review-policy.md, docs/troubleshooting.md, docs/skills.md)"
  },
  "review_loop": {
    "passes": 3,
    "blocking_found": 2,
    "deferred": 0,
    "noted": 8,
    "fixed": 5,
    "scope": "frozen",
    "rounds": 3,
    "ledgers_read": 4,
    "dispatches": {
      "specialist": 9,
      "red-team": 3
    }
  },
  "ruled_notes": [
    {
      "finding": "bin/gstack-codex-probe:1020:outside-voice",
      "head": "7e7ee2eaedd58cdcc09a6b4113b7ab3ee44aa688",
      "by": "GStack Minder",
      "reason": "the plan-review prompt is written before the Codex helper adds the git exclude; main never excludes it at all, so this PR strictly narrows the gap",
      "at": "2026-11-28T14:35:51.743Z",
      "approval": "a-b7ba5708495a",
      "relayed": "a private message"
    },
    {
      "finding": "edit:test/autoplan-guard-reasons.test.ts",
      "head": "f65701071f452c7bed7f57ef20f7d16a667d848a",
      "by": "GStack Minder",
      "reason": "comment-only pregate-literal markers on deliberate 2.1.292 test inputs",
      "at": "2026-11-28T14:49:38.743Z",
      "approval": "a-d7f03fb4080d",
      "relayed": "a private message"
    },
    {
      "finding": "edit:test/autoplan-publication-payload.test.ts",
      "head": "f65701071f452c7bed7f57ef20f7d16a667d848a",
      "by": "GStack Minder",
      "reason": "comment-only pregate-literal markers on deliberate 2.1.292 test inputs",
      "at": "2026-11-28T14:49:38.877Z",
      "approval": "a-94b6ae6c289d",
      "relayed": "a private message"
    },
    {
      "finding": "edit:test/autoplan-schema-canary-compare.test.ts",
      "head": "f65701071f452c7bed7f57ef20f7d16a667d848a",
      "by": "GStack Minder",
      "reason": "comment-only pregate-literal markers on deliberate 2.1.292 test inputs",
      "at": "2026-11-28T14:49:39.017Z",
      "approval": "a-288a9893e5ca",
      "relayed": "a private message"
    },
    {
      "finding": "edit:test/helpers/autoplan-guard-fixture.ts",
      "head": "f65701071f452c7bed7f57ef20f7d16a667d848a",
      "by": "GStack Minder",
      "reason": "comment-only pregate-literal markers on deliberate 2.1.292 test inputs",
      "at": "2026-11-28T14:49:39.149Z",
      "approval": "a-4018950e0944",
      "relayed": "a private message"
    }
  ],
  "gate_dispositions": []
}

… out of git, the autoplan guard checks Claude Code 2.1.326 (GST-4112)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 28, 2026 14:26
Review-Finding: p1/specialist-batched#1 reader=testing
Review-Finding: p1/red-team#1 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit dfbdccf into main Nov 28, 2026
57 checks passed
@garrytan garrytan mentioned this pull request Nov 28, 2026
capy-ai Bot added a commit that referenced this pull request Nov 28, 2026
- Dependency and CI action updates, each checked against its publisher. (#4873)
- The PR body check no longer loses the closing Agent notes section when the text quotes a `<!--` comment opener in inline code or a code block, (#4874)
- `/gstack-ship` stops mistaking ordinary text for Capy ids, and checks every part of a public PR body it posts. (#4872)
- `/gstack-ship` no longer puts home folder paths or Capy thread and message ids into PR bodies on public repositories. (#4868)
- `/gstack-ship` no longer stops or blocks because of time and tokens that belong to something else. (#4877)
- /gstack-ship keeps its token cap and clock when its budget start reruns mid-run. (#4882)
- `/gstack-ship` stops reopening findings that were already settled, and a missing run folder no longer costs a docs-audit attempt. (#4875)
- `/gstack-ship` closes five gaps in how it records reviews, and `--for gstack-ship` now installs the ship skill on Capy. (#4867)
- The stable release no longer skips a fully tested commit because a report-only workflow failed on it. (#4865)
- A test that copies its own `bun` binary no longer stops `/gstack-ship` with a fetch violation. (#4876)
- The secrets check no longer reports an 11-digit GitHub Actions run id as a phone number when code names it with a camelCase run identifier (#4881)
- `/review` now always runs its Codex second-model review when Codex is ready, and runs the Red Team on diffs over 200 lines. (#4870)
- The factory scorecard's red-train rate now counts each train (one batch of PRs tested together) once per report, by its branch, so re-testing the same batch inside the report's window no longer moves the rate. (#4880)
- The secrets check catches more Google API keys in encoded text, reads each JavaScript and TypeScript declaration under its own name, reports a provider key once, and stops matching look-alike values against your environment's secrets. (#4871)
- The secrets check now catches keys in JavaScript, TypeScript and Go declarations, and stops flagging JSON key paths, run folders and base64 noise. (#4869)
- The paid shared-code review test no longer fails a correct review that printed a caller file with `cat -A`. (#4878)
- The weekly benchmark line in the stable release plan now also strips C1 control characters and the Unicode line and paragraph separators (U+2028, U+2029) from record text, (#4866)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant