Repository navigation
v1.93.27.0 feat(pregate): pregate-literal markers waive one deliberate old-value line (#3490) - #3891
Merged
Merged
Conversation
… 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>
|
😎 This pull request was merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
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
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
literalscheck then failed it withPREGATE_LITERALS. The only way out waswarn: ["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.tschanges. A line without apregate-literal:marker goes through exactly the same check as before. There is no policy key for the marker, so neither a base nor a pushedpregate.jsoncan widen a waiver. gbrain and other repositories that run pregate get the marker without needing to declare anything.Approvals
Source: gstack-approvals record for gst-634-literal-markers (display only; not an approval citation).
Summary
Per-line markers (
lib/pregate/checks/literals.ts). Apregate-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:*, so a bare*/,**/or* */closer is not a reason.Every waiver is listed.
literalsprintswaived: <file>:<line>: <NAME> <old> (<reason>)for each waived line. It addsmarker added on this branchwhen 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
literalssection) and docs/troubleshooting.md (PREGATE_LITERALS) describe the marker.Proof
handoffs/GST-634/red.login the Captain drive). On this branch they pass.**/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:
consumersOfwith waivers on the same line and the line above;*//**//* */closers, marker in a string, marker two lines above;addedflag;gstack-pregatebin 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:
/* marker */was waived with*/as its reason.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):
/ */,- */) still waives the line. The behavior is unchanged from before this fix.*(*refused* input) now fails closed, so the line counts as a consumer./* … */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
consumersOfon 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 inconsumersOfandrun),test/pregate-selection.test.ts, the docs that describe the check (docs/pregate.mdliterals, docs/troubleshooting.mdPREGATE_LITERALS), and the changelog.d fragment.Documentation health:
literalsmarker paragraph now says a reason cannot start with*, so a bare*/,**/or* */closer is not a reason, matching the later review-fix commits.PREGATE_LITERALSdescribes the marker, its placement on the line or the comment line above, thewaived:listing, and whywarn: ["literals"]is the wrong fix.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_LITERALSfix 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 errorsUBICLOUD: left=0)Fixes #3490