Skip to content

v1.94.23.0 fix(pregate): strays matches only documented scratch names; literals ignores a named literal the branch only adds (GST-1211) - #3944

Merged
capy-ai[bot] merged 3 commits into
mainfrom
gst-1211-pregate-false-positives
Nov 3, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
gst-1211-pregate-false-positives

Conversation

@garrytan

@garrytan garrytan commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3944,
  "head": "568cb9dca6735c6a5d1b181b3f2f7cdca3f81302",
  "version": "1.94.15.0",
  "base": "main",
  "session_kind": "unattended",
  "run": "jam_01M6A5MQ4NASMSXCHXQS8EPCVT",
  "head_tree": "d229c46e6d1fc5da2c8d536f27e1a4cbb17dd5ca",
  "product_patch_id": "4e1310dba61f1daeb4ba25b2792bd87260542042",
  "gstack_version": "1.94.4.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 26,
    "rules": "18dcd562316f56ed",
    "base": "bf2bcf14b08d774291613c8073674a0e90eb4f9f",
    "registry": "bf2bcf14b08d774291613c8073674a0e90eb4f9f",
    "gate_scan": {
      "tagged": 0,
      "head": "568cb9dca6735c6a5d1b181b3f2f7cdca3f81302"
    },
    "reasons": [
      "gate-class",
      "runtime=26"
    ],
    "risk": []
  },
  "pregate": "requires-remote cleared @d229c46e6d1f (7 checks, current for 568cb9dca673)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41637651623/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=d229c46e6d1f tests=34761 skipped=70 runs=41637651623/1 profiles=ci-reuse/free-tests heads=568cb9dca673 verified=2026-11-03T12:47:01.290Z"
  ],
  "docs": {
    "status": "updated",
    "scope": "docs/pregate.md strays and literals rows, docs/troubleshooting.md PREGATE_STRAYS, changelog.d fragment"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 1,
    "deferred": 0,
    "noted": 4,
    "fixed": 1,
    "scope": "frozen",
    "rounds": 2
  }
}

Fixes two gstack-pregate preflight false positives that stopped /ship on real gbrain-evals work (gbrain-evals#321, GBRA-240). Both were reproduced on main with synthetic fixtures. The outside branch was read as text only.

What changed

  • strays: the scratch-name pattern in lib/pregate/checks/strays.ts matched three prefixes the docs never listed: temp, debug- and probe. So probe.py and temporal-graph-shipped.test.ts failed preflight. Main's own test/temp-dirs.test.ts and template-context-parity.test.ts would have tripped it too. The pattern now matches only the documented names: zz-*, tmp* and scratch*, plus the editor leftovers the code already caught (*.orig, *.rej, *.swp, *.swo, *.bak, *.tmp, *~, .DS_Store, Thumbs.db). docs/pregate.md and docs/troubleshooting.md now list the leftovers as well.
  • literals: callLiteralsIn kept only the last value under each name. So a new limit: 300 written after an existing limit: 10 looked like 10 changing to 300, and every test that mentioned 10 got flagged. The check now keeps every value under a name, and it reports a change only when a value disappears while the name still has a value. A literal the branch only adds isn't a change. A real edit still fails. So do two cases the last-value check could miss: one of two equal values changing, and one site being deleted while another is edited.

Reproduction (failing tests first)

Three new tests in test/pregate-selection.test.ts all fail on main bf2bcf1 and pass with this change. The fourth case, delete-plus-edit, came from review and fails without the review fix. The controls still fail preflight: zz-notes.md, tmp-x.ts, scratch.py and util.js.orig as scratch names; an existing limit: 10 edited to 20 at test/query.test.js:4; and an exported MAX going from 3 to 4.

Review

Specialist, red team and adversarial reviewers (Opus 5.5) and the GPT-6.1 Sol outside voice reviewed the change, then a scoped fix-check reviewed the fix and came back clean. All four reviewers found the same P2, and it's fixed: values removed past the number of added values were dropped, so a delete-plus-edit could hide the edited site's old value. Open notes, none at the blocking floor:

  • When two sites swap values (10↔20), the set of values doesn't change, so nothing is reported. Main caught one side of a swap. Catching both needs per-site matching.
  • The "now N" in a literals message pairs values by source order, so it can name the wrong new value. The search uses the old value, which is always right.
  • New debug-*, probe* and temp* files no longer count as strays. That's intended, because they aren't documented scratch names.

Tests

test/pregate-selection.test.ts and test/pregate-user-policy.test.ts: 70 pass. Typecheck is clean. The full free suite ran on the lane machine because this touches lib/pregate/*. It had 269 failures in 38 setup, install, CSO and host-render files, and no pregate file failed. The same 38 files also fail on this machine at main bf2bcf1, with the same total of 269 failures (I compared counts, not individual test names). The runner also noticed shards writing under the real ~/.gstack/projects, which is an environment problem. CI is the clean full run: Free Tests run 41637651623 passed at this head.

Security read

No network calls, environment reads, permission changes, workflow edits or new dependencies.

Open in Capy

garrytan and others added 2 commits November 3, 2026 11:59
…als ignores a named literal the branch only adds (GST-1211)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…l has one, so a delete-plus-edit keeps the edited site's old value (GST-1211 review)

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

trunk-io Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@github-actions github-actions Bot changed the title fix(pregate): strays matches only documented scratch names; literals ignores a named literal the branch only adds (GST-1211) v1.94.23.0 fix(pregate): strays matches only documented scratch names; literals ignores a named literal the branch only adds (GST-1211) Nov 3, 2026
@capy-ai
capy-ai Bot merged commit b3e9e5d into main Nov 3, 2026
50 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