Skip to content

v1.93.27.0 feat(pregate): pregate-literal markers waive one deliberate old-value line (#3490) - #3891

Merged
capy-ai[bot] merged 6 commits into
mainfrom
gst-634-literal-markers
Nov 2, 2026
Merged

capy-ai[bot] merged 6 commits into
mainfrom
gst-634-literal-markers

Conversation

@garrytan

@garrytan garrytan commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3891,
  "head": "0ac7db561891b5038c4ddd62a53a800042b423fe",
  "version": "1.93.15.0",
  "base": "main",
  "gate": {
    "pregate-local": {
      "pass": 103,
      "fail": 0,
      "skip": 0
    },
    "typecheck": {
      "pass": 1,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "904310167968d63e9ece8632ca7699e01b791811",
  "product_patch_id": "04a3e68d05349f14ef458100613d79755027a0ec",
  "gstack_version": "1.93.15.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 55,
    "rules": "b2272efd321ce7cb",
    "base": "9cc40e0d03eed66cd74cd57f463bdbb420e84990",
    "registry": "9cc40e0d03eed66cd74cd57f463bdbb420e84990",
    "gate_scan": {
      "tagged": 0,
      "head": "0ac7db561891b5038c4ddd62a53a800042b423fe"
    },
    "reasons": [
      "gate-class",
      "runtime=55"
    ],
    "risk": []
  },
  "pregate": "requires-remote cleared @904310167968 (1 checks, current for 0ac7db561891)",
  "requires_remote": [
    "pregate.json/remote_gate: remote-gate tree=904310167968 tests=2180"
  ],
  "issues": {
    "fixes": [
      3490
    ],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/ (131 docs files hashed), the release diff 90ccf30e...ed69fe82: docs/pregate.md literals, docs/troubleshooting.md PREGATE_LITERALS, changelog.d fragment"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 1,
    "deferred": 0,
    "noted": 4,
    "fixed": 2,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 3,
    "dispatches": {
      "specialist": 2,
      "red-team": 2
    }
  },
  "review_loop_exception": {
    "accepted_by": "GStack Minder (Captain)",
    "date": "2026-11-02",
    "via": "GSTA-212 Captain reply to the fix-check stop",
    "reason": "the only CRITICAL is the fix-check's own negated summary ('nothing is CRITICAL'); the post-check edit 0ac7db56 is a one-sentence docs clarification.",
    "fix_check": {
      "head": "ed69fe8271b15448cdc09d9933350cf915ac194a",
      "findings": 4
    }
  }
}

What changed

A marked refused-input line is waived and listed; the real consumer and a reason-less marker still fail literals

A marked refused-input line is waived and listed. The real consumer and a reason-less marker still fail literals.

Before/after as text: A marked refused-input line is waived and listed; the real consumer and a reason-less marker still fail literals
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+$ literals check, MIN_RUNTIME bumped 1.4.0 -> 1.4.4 (this branch)
+PREGATE_LITERALS consumers of MIN_RUNTIME ('1.4.0' -> '1.4.4'): test/runtime.test.ts:3, test/no-reason.test.ts:2
+waived: test/runtime.test.ts:2: MIN_RUNTIME '1.4.0' (refused input below the minimum) marker added on this branch
-$ literals check, MIN_RUNTIME bumped 1.4.0 -> 1.4.4 (main 90ccf30e)
-PREGATE_LITERALS consumers of MIN_RUNTIME ('1.4.0' -> '1.4.4'): test/runtime.test.ts:2, test/no-reason.test.ts:2
 

Why

#3490: when a minimum version goes up, the test that checks the old version is refused has to keep the old value. Pregate's literals check then failed it with PREGATE_LITERALS. The only way out was warn: ["literals"], which turns the check off for every constant. Now that one line can carry // pregate-literal: NAME=<old value> <reason>. #3490's second half (the remote pregate) was already fixed by #3661 (v1.91.348.0), so with this PR the issue is done.

Blast radius

Only lib/pregate/checks/literals.ts changes. A line without a pregate-literal: marker goes through exactly the same check as before. There is no policy key for the marker, so neither a base nor a pushed pregate.json can widen a waiver. gbrain and other repositories that run pregate get the marker without needing to declare anything.

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-11-02 Grant one scoped fix-check for GST-634 at ed69fe8 (review_loop_grant), or say ship “GST-634: do it. One scoped fix-check (review_loop_grant, stop head ed69fe8, the 2-line range in lib/pregate/checks/literals.ts) is my rule 23 word.” (GStack Minder (Captain)) approved review_loop_grant: one scoped fix-check at stop head ed69fe8, range c38e8de..ed69fe8 none
2026-10-31 Approve the GST-634 fix-lane plan (D1 per-line marker, D2 drop #3490 part 2 as fixed by #3661, D3 report branch-added markers without an issue link) “do it. D1 is the per-line marker, D2 drops #3490's second half as already fixed by #3661 (v1.91.348.0), and D3 reports branch-added markers without requiring an issue link.” (GStack Minder (Captain)) approved the GST-634 fix-lane plan, D1-D3, within the $40 cap none

Source: gstack-approvals record for gst-634-literal-markers (display only; not an approval citation).

Summary

Per-line markers (lib/pregate/checks/literals.ts). A pregate-literal: NAME=<old value> <reason> comment (//, # or /*), on the flagged line or on the comment line directly above it, waives that line. It only does so when it names the changed constant and its old value and gives a reason. The rules:

  • Every other line in the file is still checked.
  • A marker for another constant or another value doesn't waive anything.
  • Marker text inside a string is not a marker.
  • A marker two lines above doesn't reach the flagged line.
  • A reason cannot start with *, so a bare */, **/ or * */ closer is not a reason.

Every waiver is listed. literals prints waived: <file>:<line>: <NAME> <old> (<reason>) for each waived line. It adds marker added on this branch when the merge-base file lacks the marker, so a reviewer sees each new waiver without the PR needing an issue link.

Docs. docs/pregate.md (the literals section) and docs/troubleshooting.md (PREGATE_LITERALS) describe the marker.

Proof

  • Red first. On main 90ccf30, both new tests fail, 2 of 2 (handoffs/GST-634/red.log in the Captain drive). On this branch they pass.
  • Review fixes, red first too. The **/ and * */ closer cases fail on the pass-2 regex and pass on the fix (handoffs/GST-634/red-closer.log).

Security read

There are no network calls, no new environment variables, no secrets, no dependencies, and no changes to .github/workflows, setup, install or upgrade scripts. No outside code was carried over.

Test Coverage

The new code paths are covered by tests:

  • consumersOf with waivers on the same line and the line above;
  • wrong constant, wrong value, no reason, */ / **/ / * */ closers, marker in a string, marker two lines above;
  • a same-line marker for another constant beside a matching line-above marker;
  • the merge-base added flag;
  • the gstack-pregate bin listing the waiver.

Tests ran: pregate-local 103
Tests ran: typecheck count unavailable
Tests ran: remote gate (Ubicloud us-east-a2) 2180, 0 failed, tree 904310167968, $0.05

Pre-Landing Review

Pass 1 (gate class, full depth: the batched specialist, then Red Team) found 2 INFORMATIONAL findings. Both are fixed in c38e8de:

  • A reason-less /* marker */ was waived with */ as its reason.
  • A same-line marker for another constant hid a matching marker on the line above.

Pass 2 (full) found nothing. In Step 11, the outside voice (openai/gpt-6.1-sol) approved. The native adversarial voice found that **/ and * */ closers still counted as reasons. The reviewer wrote that finding as Low, but it collected as CRITICAL (FIXABLE, GST-1031). It is fixed in ed69fe8. The Captain granted one scoped fix-check (a-59ebed9bd1c5), which confirmed the fix.

The fix-check's closing sentence ("nothing is CRITICAL") collected as a CRITICAL finding (negated label, added to GST-1031). The docs audit's one-sentence clarification came after the fix-check. The Captain accepted both as the review-loop exception below.

Open notes from the fix-check (below the floor, not fixed):

  • A reason made only of punctuation (/ */, - */) still waives the line. The behavior is unchanged from before this fix.
  • A real reason that starts with * (*refused* input) now fails closed, so the line counts as a consumer.
  • Text after a closed /* … */ marker on the same line isn't scanned for the old value. The behavior is unchanged from before this fix.

REVIEW_LOOP: passes=2 blocking_found=1 deferred=0 noted=4 fixed=2 scope=frozen fix_checks=1 dispatches=4
Review-loop exception: accepted by GStack Minder (Captain) 2026-11-02 via GSTA-212 Captain reply to the fix-check stop: the only CRITICAL is the fix-check's own negated summary ('nothing is CRITICAL'); the post-check edit 0ac7db5 is a one-sentence docs clarification. (fix-check at ed69fe8, 4 findings)
Gate edits: none detected (3 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: completed, no findings.

Exploratory QA

The smoke probe is the before/after capture above. It runs main's and this branch's consumersOf on the same two-file fixture. No browser surface changed.

Design Review

No frontend files changed, so design review was skipped.

Eval Results

No prompt-related files changed, so evals were skipped.

Plan Completion

The plan is handoffs/GST-634/plan.md (D1 per-line marker, D2 drop #3490's second half as fixed by #3661, D3 report branch-added markers without an issue link). All three are done.

TODOS

No TODO items completed in this PR.

Documentation

Status: updated. One factual clarification in docs/pregate.md; no blockers.

Scope: the release diff 90ccf30...ed69fe8 on gst-634-literal-markers (committed files only; nothing staged, unstaged or untracked): lib/pregate/checks/literals.ts (MARKER, markerIn, LiteralWaiver, waiver handling in consumersOf and run), test/pregate-selection.test.ts, the docs that describe the check (docs/pregate.md literals, docs/troubleshooting.md PREGATE_LITERALS), and the changelog.d fragment.

Documentation health:

  • docs/pregate.md: Updated. The literals marker paragraph now says a reason cannot start with *, so a bare */, **/ or * */ closer is not a reason, matching the later review-fix commits.
  • docs/troubleshooting.md: Current. PREGATE_LITERALS describes the marker, its placement on the line or the comment line above, the waived: listing, and why warn: ["literals"] is the wrong fix.
  • changelog.d/gst-634-literal-markers.md: Current. Accurate against the code; not edited.
  • CHANGELOG.md: Current. Not modified on this branch.

Coverage:

  • pregate-literal: marker: reference in docs/pregate.md, how-to in docs/troubleshooting.md, no tutorial or explanation. This is a common gap, acceptable for a check option.
  • waived: output line: reference in docs/pregate.md and the changelog fragment.

Debt: the PREGATE_LITERALS fix text in lib/result-codes.ts still says only "update ... or keep the old constant" and doesn't mention the marker (source, not docs).

Diagram drift: none. No diagrams reference the literals check.

Test plan

  • bun test test/pregate-selection.test.ts test/pregate-user-policy.test.ts test/pregate-head-policy.test.ts test/module-size-ratchet.test.ts test/spawnsync-timeout-tripwire.test.ts test/bun-entry-isolation.test.ts (the focused lane)
  • bun run typecheck: zero errors
  • Remote pregate (Ubicloud us-east-a2) on the finished tree 904310167968, VM torn down (UBICLOUD: left=0)
  • Red on main for both new tests and for the closer cases

Fixes #3490

garrytan and others added 5 commits November 2, 2026 19:26
… line (#3490)

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>
…ery marker on and above the line counts)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… not reasons)

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>
@trunk-io

trunk-io Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@github-actions github-actions Bot changed the title feat(pregate): pregate-literal markers waive one deliberate old-value line (#3490) v1.93.27.0 feat(pregate): pregate-literal markers waive one deliberate old-value line (#3490) Nov 2, 2026
@capy-ai
capy-ai Bot merged commit e850054 into main Nov 2, 2026
46 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.

pregate: declared waiver for intentional old-value literals, and dot-directory paths in the import graph

1 participant