Skip to content

Pull requests get a Test changes summary of deleted or skipped tests and edits to their own checks (GST-3386) - #4645

Merged
capy-ai[bot] merged 7 commits into
mainfrom
test-changes-report
Nov 22, 2026
Merged

capy-ai[bot] merged 7 commits into
mainfrom
test-changes-report

Conversation

@garrytan

@garrytan garrytan commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Every gstack pull request now gets a flag-only Test changes check listing removed or skipped tests, loosened limits and edits to the files that run its own checks.
Why: agents write most of our tests, and a pull request shouldn't be able to quietly weaken them or grade itself with an edited checker; this two-week trial measures how often that happens.
Nothing to do: the check isn't required, and a flag never turns it red.

What changed

Pull requests now get a Test changes summary; main had none

Pull requests now get a Test changes summary; main had none.

Before/after as text: Pull requests now get a Test changes summary; main had none
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+$ bun scripts/test-changes-report.ts --base dd611038 --head f362224b --summary-file summary.md
+TEST_CHANGES: tagged={} tests_added=14 tests_removed=0 gate_files=1 unread=0 candidate=dd611038ca41..f362224be5d2
+
+## Test changes (flags never fail this check)
+
+Tests added: 14. Tests removed: 0. Hunks that remove or skip a test (RH-1), add a suppression (RH-13), bypass a gate (RH-14) or relax a gate value (RH-15): 0.
+
+**This pull request edits files that run or define its own checks:**
+
+- `.github/workflows/test-changes.yml`
+
+Each flag needs a reason in the pull request, or a reviewer ruling. See docs/ship-policy.md#test-changes.
-$ git cat-file -e origin/main:.github/workflows/test-changes.yml
-fatal: path '.github/workflows/test-changes.yml' exists on disk, but not in 'origin/main'
-(main has no Test changes check: a pull request that deletes or skips tests gets no summary)
 

A pull request could delete or skip a test, or edit the workflow that grades it, and nothing on the pull request said so. Now a check on every pull request lists hunks that remove or skip a test, add a suppression, bypass a check or loosen a limit, counts test declarations added and removed, and names edits to the files that run this repository's own checks. It runs main's copy of the scan on pull_request_target, reads the pull request's commits as git objects without checking them out, and exits 0 on any flag. gstack-gate-diff gains --head <sha> to scan merge-base to a fetched commit without touching the working tree.

Why

"A pull request shouldn't be able to grade itself." Agents write most of our tests, so this trial shows reviewers, on every pull request, where tests or checks got weaker, and measures how often that happens before anything is made blocking.

Blast radius

The new workflow is not a required check and never checks out or runs pull request code. It checks out main only with a read-only, non-persisted token, and pull request fields reach the shell only through env: (test/test-changes-workflow-safety.test.ts, read and run). gstack-gate-diff keeps its working-tree path unchanged unless --head is passed (bin/gstack-gate-diff, file:line read; 141 focused tests and the full free suite passed at this head).

Test Coverage

Coverage: 67% of 15 changed code paths have a test at two stars or better; 0 regressions found. Tests: 1855 → 1855 (audit only, the head was frozen).
Leftover gaps, proposed but not written: declarations in .md/.json hunks not counted; RH-13/14/15 counts (only RH-1 exercised); --base without --head rejected; gstack-gate-diff --head with no sha; the partial-read line.
Tests ran: focused 141
Tests ran: free 1736 files (from the CI run at this head)

Pre-Landing Review

No blocking issues. This was a read-only final review of this head: six readers (a batched testing, security and state-machine reader, a red team, an adversarial reader, a second-model review on gpt-6.1-sol, and a targeted reader for check-editing code) all returned no blockers. The second-model review's verdict was clean.

Below-floor notes, shipped as notes:

  • A [skip ci] commit whose subject looks like a test declaration can raise the "tests added" count by one.
  • The "Partial read … were not tagged" summary line is worded too strongly: hunks past the reading cap are still tagged.
  • Unpaired loosened limits (gate-diff's RH-15? tag) aren't reported; the doc doesn't say so.
  • The workflow has not run on GitHub yet; the blobless fetch without stored credentials is proven only by the first run after merge.
  • The replay figures in docs/ship-policy.md were recounted from a full clone: 303 landings, 24 tagged, 50 editing a listed check file, 0 errors, matching the doc.
Review notes

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

  • INFORMATIONAL sf-21aeda12e999 security finding, details recorded privately
  • INFORMATIONAL sf-029f7901d801 security finding, details recorded privately
Exploratory QA

Functional, smoke budget: a normal run over this pull request exited 0, printed the TEST_CHANGES line and wrote the summary without touching the working tree; an unknown head commit exited 1 with TEST_CHANGES: error and head_unresolvable. Verdict: pass. Not run locally: the real refs/pull/N/head fetch under pull_request_target.

Eval Results

No prompt-related files changed — evals skipped.

Scope Drift

Scope Check: CLEAN

TODOS

No TODO items completed in this PR.

Documentation

Status: current. The documentation already matches this branch, so no edits were needed (read-only audit).

Scope: dd61103..f362224 on test-changes-report, 7 commits, 11 files. The audit covered the committed diff; there was no staged, unstaged or new-file content. The changes are the new flag-only Test changes workflow (.github/workflows/test-changes.yml, scripts/test-changes-report.ts), gstack-gate-diff --head <sha> and diffRange in lib/gate-diff/git.ts, the free-workflow listing in scripts/test-pr-profile.ts, and tests.

Documentation health:

  • docs/ship-policy.md: Current. The new #test-changes section matches the workflow, the watched-file list, the four tags (RH-1/13/14/15) and the exit behavior.
  • changelog.d/test-changes-report.md: Current, read only.
  • docs/designs/HONEST_WORK_GATE_INTEGRITY.md: Advisory. Its CLI contract predates --head.
  • docs/troubleshooting.md: Gap. There is no entry for GATE_ERROR=internal reason=head_unresolvable.
  • docs/PROJECT_STRUCTURE.md, CONTRIBUTING.md: Current. Their workflow summaries are generic and need no entry.

Coverage debt:

  • gstack-gate-diff --head has reference coverage (usage text, ship-policy) but no how-to or troubleshooting entry.
  • The Test changes check has reference and explanation coverage in ship-policy and no how-to for reading its summary.

Diagram drift: none found.

Tests
  • focused (bun test over the report, workflow-safety, gate-diff CLI and lib, free-fixtures, ci-history-read, pr-profile and harness-version tests): 141 pass, 0 fail
  • bun run test: carried from the free-tests run at this head (1736 files, 0 failed)
Agent notes

Part B of GST-3386; land refusal (Decision B2) is out of scope until the trial reports. Lane GSTA-749.

Approvals

No approvals recorded for branch test-changes-report.
Plan: approved (record r-4819689303c4)
Plan check: approved (record r-4819689303c4)

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=7 fixed=0 scope=frozen ledgers_read=2 dispatches=4
Gate edits: none detected (4 listed, 2 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

{
  "schema_version": 1,
  "pr": 4645,
  "head": "f362224be5d2e3b25a88d95921c3ec6119f08dae",
  "version": "1.102.2.0",
  "base": "main",
  "gate": {
    "focused": {
      "pass": 141,
      "fail": 0,
      "skip": 0
    },
    "free": {
      "pass": 1736,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 44971543148,
      "attempt": 1,
      "tree": "8f876624b285706c477013cdd6ef573602dd5763"
    }
  ],
  "calls": 12,
  "session_kind": "unattended",
  "run": "/home/user/.capy/work/ship4645-f362224",
  "head_tree": "8f876624b285706c477013cdd6ef573602dd5763",
  "product_patch_id": "149990331a377d3eed42936f850736764c6dc436",
  "gstack_version": "1.102.2.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 256,
    "rules": "85b3923b1a978e41",
    "base": "d8abe59096b6205b84fa80162083c702f6ff4703",
    "registry": "d8abe59096b6205b84fa80162083c702f6ff4703",
    "gate_scan": {
      "tagged": 1,
      "head": "f362224be5d2e3b25a88d95921c3ec6119f08dae"
    },
    "reasons": [
      "gate-class",
      "runtime=256"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @8f876624b285 (8 checks, current for f362224be5d2)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44971543148/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=8f876624b285 tests=38729 skipped=67 runs=44971543148/1 profiles=ci-reuse/free-tests heads=f362224be5d2 verified=2026-11-22T01:33:30.800Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md (read-only audit of dd611038..f362224b)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 7,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "ledgers_read": 2,
    "dispatches": {
      "specialist": 3,
      "red-team": 1
    }
  },
  "gate_dispositions": [],
  "review_targeted": {
    "classes": [
      "gate"
    ],
    "rules": "b3f6f8b4843c0c30",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "149990331a377d3eed42936f850736764c6dc436",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}
{"head":"7accf35b049bced828b9fed1d2fccba13715e1e3","run":"ship4645-035e01a","status":"started","review_loop":{"passes":1,"blocking_found":0,"deferred":0,"noted":0,"fixed":2,"scope":"frozen","rounds":1}}
{"head":"f362224be5d2e3b25a88d95921c3ec6119f08dae","run":"ship4645-225e5e3","status":"started","review_loop":{"passes":1,"blocking_found":1,"deferred":0,"noted":5,"fixed":2,"scope":"frozen","fix_checks":1,"rounds":1,"est_input_tokens":21374,"dispatches":{"specialist-batched":1,"red-team":1,"fix-check":1}}}

…and edits to their own checks (GST-3386)

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

trunk-io Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 6 commits November 22, 2026 00:37
…ee workflow

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: lib/gate-diff/git.ts:314:stale-comment reader=core
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…an off the persist-credentials assertion

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…s a non-behavioral harness change

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Test changes report names test files git can only read as binary, undecodable, symlink or submodule, so a removal hidden in one never reads as a quiet pass.

Review-Finding: p1/red-team#1 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Test changes report takes its file list from the same merge base the scan used, so a stale local main never lists upstream edits to check files as the pull request's own.

Review-Finding: p3/outside-voice#1 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 973b49e into main Nov 22, 2026
77 checks passed
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