Skip to content

Changed-number check stops flagging tests that only share a word like limit (#4478) - #4496

Merged
capy-ai[bot] merged 2 commits into
mainfrom
call-site-literals-need-the-module
Nov 18, 2026
Merged

capy-ai[bot] merged 2 commits into
mainfrom
call-site-literals-need-the-module

Conversation

@garrytan

@garrytan garrytan commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

/ship's changed-number check no longer stops on tests that only use the same word as a changed property: lowering limit: 120 to 30 used to report every test that said "limit" and held 120.
Why: docs/pregate.md already said a test counts for a word like limit only when it also names the changed module, but the code enforced that only for one-character values. Tests that import the module are still reported.
Nothing to do. Thanks to @dtoelke, who reported this and sent the first fix in #4478.

What changed
  • lib/pregate/checks/literals.ts, one condition in consumersOf. A test file is read for the old value when it passes the existing name-or-module rule and, for a lowercase call-site name (limit, attempts, timeout), also names the changed module. Before, the second part applied only when the old value was one character long. Uppercase constants (SEND_LIMIT, ARM_SHARDS) are matched exactly as before.
  • docs/pregate.md. The call-site sentence now says the module rule holds whatever the old value's length.
  • Test in test/pregate-selection.test.ts: two files that only use the word, plus one that imports a sibling rate-limits-v2, are no longer reported; two files that import src/rate-limits still are.
Why

"Lowering a rate limit from 120 to 30 flagged 30 unrelated test files" (#4478). The check now asks the same question for every call-site value that the docs already described, so a test is reported only when it can actually see the changed module.

Blast radius

Only consumersOf changes, and only for a lowercase call-site name whose old value is two or more characters; constants and one-character values follow the same path as before (file:line read: lib/pregate/checks/literals.ts:138, both predicates walked branch by branch in review). A test reached only through a wrapper that never names the module's stem is no longer reported; the check is advisory, so such a test is caught only when a CI run includes it (a nightly-only test would surface after merge).

Pre-Landing Review

No blocking issues. The full review panel (a batched specialist covering testing, security and state machines, a red team, a native adversarial reader and a second-model review on openai/gpt-6.1-sol) read the whole diff; the second-model verdict was CLEAN. Two low notes are listed below and were not fixed in this PR.

Review notes

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

  • INFORMATIONAL lib/pregate/checks/literals.ts:138 A call-site literal reached only through a wrapper, subprocess or barrel that never names the module stem is no longer reported; intended and documented trade-off, advisory check, CI is the backstop
  • INFORMATIONAL test/pregate-selection.test.ts:329 The SEND_LIMIT toEqual([]) assertion proves nothing because no fixture holds SEND_LIMIT; it does not show an uppercase name still counts alone
Exploratory QA

Functional smoke on consumersOf with synthetic fixtures in an owned temporary directory (2 probes, 300 s budget), verdict pass:

  • Success: a call-site literal limit (old 120) is reported only in the test that imports the changed module.
  • Edge: an uppercase constant still counts by name alone, and a one-character call-site value still needs the module.

Limit: smoke only; the full suite ran in CI.

Eval Results

No prompt-related files changed — evals skipped.

Scope Drift

Scope Check: CLEAN

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.

Issues

Refs #4478
reference #4478 ← commit 5be236b: Changed-number check stops flagging tests that only share a word like limit (#4478) (promote: fix #4478)

TODOS

No TODO items completed in this PR.

Tests
  • CI free suite at this tree (run 44344622859, attempt 2): 1698 test files, 0 failed; macOS named regressions and Windows smoke green at this head.
  • bun test test/pregate-selection.test.ts: 55 of 55 pass; the new test fails on main's literals.ts (3 extra hits) and passes here.
  • bun run typecheck: clean.
Evidence
  • An end-to-end fixture repo of our own through bin/gstack-pregate --only literals: with the importer's test left at 120 the check fails on that file only and not on the word-only test; once the importer is updated it passes.
Agent notes

Documentation

Status: current. No documentation edits were needed.

Scope: the committed diff fda9dea..5be236b on call-site-literals-need-the-module: lib/pregate/checks/literals.ts (the call-site module rule now applies whatever the old value's length), test/pregate-selection.test.ts, docs/pregate.md and changelog.d/call-site-literals-need-the-module.md. There were no staged, unstaged or new files.

Documentation health:

  • docs/pregate.md: current. The branch's own edit to the literals bullet matches the new condition.
  • changelog.d/call-site-literals-need-the-module.md: current. It is accurate against the code and test.
  • CONTRIBUTING.md, docs/TESTING_INTERNALS.md: current, with no overlap.

Coverage debt: none. This is an internal pregate check whose reference entry is docs/pregate.md. Diagram drift: none.

Approvals

No approvals recorded for branch call-site-literals-need-the-module.
Plan: exempt: bug fix (R65 bug fixes skip plan review; the new test in test/pregate-selection.test.ts covers the repro)
Plan check: exempt bug fix

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

Open in Capy

{
  "schema_version": 1,
  "pr": 4496,
  "head": "4d201b931ef4506152aee2bd9bd08d74ab976aae",
  "version": "1.100.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1698,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 44344622859,
      "attempt": 2,
      "tree": "06b05e13e180d56e36db18ccd5d403926666a293"
    }
  ],
  "calls": 17,
  "session_kind": "unattended",
  "run": "/home/user/.capy/work/ship-4496-5be236b",
  "head_tree": "4c632ce11b93feaaa976ea43e14ff0b86fc0185a",
  "product_patch_id": "b301680c8cd0999224ee9a121b28c0783697cf7c",
  "gstack_version": "1.100.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 8,
    "rules": "1afa38a4be3b5eef",
    "base": "b6ca54ec09a7f35607dd2f46b055dbc8ca092d9b",
    "registry": "b6ca54ec09a7f35607dd2f46b055dbc8ca092d9b",
    "gate_scan": {
      "tagged": 0,
      "head": "4d201b931ef4506152aee2bd9bd08d74ab976aae"
    },
    "reasons": [
      "gate-class",
      "runtime=8"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @4c632ce11b93 (8 checks, current for 4d201b931ef4)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44352068128/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44350304767/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=4c632ce11b93 tests=37837 skipped=67 runs=44352068128/1 profiles=ci-reuse/free-tests heads=4d201b931ef4 verified=2026-11-18T16:59:48.309Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [
      4478
    ],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md against fda9dea7..5be236bc"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 2,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "ledgers_read": 2,
    "dispatches": {
      "specialist": 3,
      "red-team": 1
    }
  },
  "gate_dispositions": [],
  "carry": {
    "from": "5be236bcaab1324625d5c0a0a6049ab45aeb113e",
    "reason": "test-only change",
    "product_patch_id": "b301680c8cd0999224ee9a121b28c0783697cf7c",
    "changed_paths": [
      "test:test/pregate-selection.test.ts"
    ],
    "merge_commits": 0,
    "range_diff": "1:  5be236bc = 1:  5be236bc Changed-number check stops flagging tests that only share a word like limit (#4478)\n-:  -------- > 2:  4d201b93 Test that an uppercase constant still counts by name alone",
    "covers": [
      "pre-landing review",
      "adversarial review",
      "gate integrity",
      "documentation audit"
    ],
    "reruns": [
      "CI at head (gstack-ship-queue ready requires it); test and helper code changed since the reviewed head runs there unreviewed"
    ],
    "ancestry": "linear",
    "trees": [
      "06b05e13e180d56e36db18ccd5d403926666a293"
    ]
  }
}
{"head":"5be236bcaab1324625d5c0a0a6049ab45aeb113e","version":"1.100.0.0","gstack_version":"1.100.0.0","run":"/home/user/.capy/work/ship-4496-5be236b","review_loop":{"passes":1,"blocking_found":0,"deferred":0,"noted":2,"fixed":0,"scope":"frozen","rounds":1,"ledgers_read":2,"dispatches":{"specialist":3,"red-team":1}},"depth":"full"}

… limit (#4478)

A test now counts for a lowercase call-site name such as limit only when
it also names the changed module, whatever the old value's length, as
docs/pregate.md already said. Tests that import the module are still
reported.

Reported by @dtoelke in #4478.

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

trunk-io Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@capy-ai

capy-ai Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Flaky rerun: cso-macos-launcher failed two CSO registry-socket watchdog tests on run 44344622859 attempt 1 (ISOLATION_FAILED, "watchdog did not remove the exact private root"). This PR changes only the pregate literals check, so I reran the failed jobs once at the same head, and attempt 2 passed. It's logged as flaky.

The #4478 test's uppercase control asserted an empty list on a fixture
that never held the name, so it proved nothing. It now holds a file that
names SEND_LIMIT without the module and expects it reported.

Three fixture lines in this test come from @dtoelke's #4478.

Co-authored-by: dtoelke <[email protected]>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 0ab5657 into main Nov 18, 2026
79 checks passed
stackpt-agent added a commit to dtoelke/gstack that referenced this pull request Nov 18, 2026
…an#4496)

lib/pregate/checks/literals.ts takes upstream's condition for a lowercase
call-site name and keeps the fork's rule for an uppercase constant on top
of it; docs/pregate.md and fork/README.md say the same.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@garrytan garrytan mentioned this pull request Nov 19, 2026
capy-ai Bot added a commit that referenced this pull request Nov 19, 2026
- `gstack-artifact validate` no longer passes a run.json that gstack-autoplan never wrote. (#4494)
- /ship's changed-number check no longer stops on tests that only share a word with the change (#4478). (#4496)
- On Capy, /ship no longer edits or comments on pull requests as you. (#4518)
- The destructive-command check stops asking about scratch deletes and catches the real damage it used to miss. (#4513)
- The destructive-command check reads commands more carefully, closing gaps found after the last release. (#4525)
- The Codex readiness check and the second-model review now pick the same model for a custom Codex provider (GST-3089). (#4491)
- gstack's Codex hooks work when your Codex folder's path has a `(`, `&` or other shell character in it. (#4528)
- Uninstalling gstack keeps your own Codex hooks trusted. (#4528)
- Codex hook setup matches Codex more closely. (#4528)
- On Windows, setup copies the Claude Code hook code that gstack's Codex hooks import (#4528)
- /review's checklist on Codex reads shell commands more carefully. (#4528)
- On Codex, gstack now suggests the right skill for a prompt and stops destructive commands before they run. (#4512)
- On Codex, /review is now held once when it tries to finish without its adversarial pass or its report, as it already is on Claude Code. (#4522)
- On Codex, gstack's skill suggestion now names the skill the way Codex lists it. (#4523)
- On Codex, gstack's suggested prompts and docs now name skills the way Codex lists them. (#4524)
- /review on Codex with gpt-6.1-sol is no longer held back for a second-model pass it already ran. (#4526)
- On Codex, office-hours, plan-design-review and gstack-upgrade work again when you name them. (#4510)
- gstack knows when Codex is running unattended. (#4510)
- Codex reviewers start with a clean context. (#4510)
- Docs no longer say Codex has no hook support. (#4510)
- A command whose output was cut off no longer counts as a finished read. (#4492)
- A folder marked as published data can no longer hide source code or agent files from /ship's review. (#4516)
- Correction to the on-by-default helper hooks entry: the hook still routes only to /review, /qa and /verify, so skills you've installed yourself aren't suggested yet. With gstack's skills it routes 14 of 60 real bug reports (was 17), and long prompts are no longer skipped. (#4505)
- /sync-gbrain's read check now works when the first page in your code source is over 64 KB. (#4497)
- Free-suite CI no longer fails before any test runs when Ubuntu's package mirror is slow. (#4530)
- Syncing a second repo no longer makes the first one ask for /sync-gbrain again. (#4532)
- gstack's helper hooks are now on by default in Claude Code, OpenClaw and Hermes, and the prompt-routing hook fires on real bug reports. (#4503)
- `gstack-pregate clear --receipt` accepts a remote gate run from before a merged release when the release only regenerated a declared release output. (#4483)
- The second-model review now keeps the reviewer's own result, and reports a used-up budget as a budget stop. (#4515)
- When the reviewer wrote its review to the result file it was asked for, Codex then replaced that file with its short closing message ("Done, I wrote the review"), so the review was thrown away and reported as missing its markers. (#4515)
- When the provider refuses the call with HTTP 402 Payment Required (usually a metering proxy that hit its allowance, or an account out of credits or quota), gstack used to record only "exit 1". (#4515)
- The pre-commit /verify check now fails a check that times out, and its checks share one time budget (GST-3201). (#4527)
- /ship's review collector no longer reads a reviewer's own scope list or list of passed checks as findings (GST-3201). (#4527)
- Merge-queue stack tests fail when git cannot list a PR's added test files (GST-3201). (#4527)
- /ship can now review results PRs that publish raw session data. (#4511)
- /ship's review pass works when the checkout you ship isn't the project's default checkout. (#4507)
- A second review round no longer reports done when nothing was reviewed. (#4520)
- The prompt-routing hook now suggests skills you install yourself, and no longer sends ordinary bug reports to /qa (GST-3123). (#4506)
- gstack's script runner and merge-queue checks now also refuse cut-off output. (#4502)
- A failed second-model review reports the cause that actually stopped it, and the runner never deletes its own prompt. (#4519)
- `gstack-ship-queue ready` now fills in the trial merges and the second-model trail read instead of printing lines to fill. (#4529)
- Five small ship-tool fixes. (#4529)
- A ruling the owner gives while a `/ship` run is open can be relayed. (#4529)
- /ship no longer kills a working test run as stalled when the test command starts its workers in their own session. (#4533)
- /ship no longer stops a review because the state-machine reader started its reply the way its instructions say. (#4504)
- When Claude Code runs /verify right before a commit, it now gets a quick check instead of the full fix loop (GST-3150). (#4508)

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