Skip to content

v1.94.13.0 fix(review): bare --base reads origin/<base> in review and ship bins; diff-scope matches auth as a word (GST-1036, GST-1065) - #3906

Merged
capy-ai[bot] merged 8 commits into
mainfrom
capy/bare-base-reads-originbase
Nov 3, 2026
Merged

capy-ai[bot] merged 8 commits into
mainfrom
capy/bare-base-reads-originbase

Conversation

@garrytan

@garrytan garrytan commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3906,
  "head": "9417c7d380d0d4ad5b267cfe71b01ee906dd3960",
  "version": "1.93.33.0",
  "base": "main",
  "gate": {
    "targeted": {
      "pass": 99,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "46a111406564a46c82791543bfc90b6418e48a95",
  "product_patch_id": "f4eec290558268dda961b48f57c6ef55e7157e11",
  "gstack_version": "1.93.33.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 104,
    "rules": "b2272efd321ce7cb",
    "base": "d4bef0a6a314b21a85bd85f516a43ec48bc94999",
    "registry": "d4bef0a6a314b21a85bd85f516a43ec48bc94999",
    "gate_scan": {
      "tagged": 0,
      "head": "9417c7d380d0d4ad5b267cfe71b01ee906dd3960"
    },
    "reasons": [
      "gate-class",
      "runtime=104"
    ],
    "risk": []
  },
  "pregate": "requires-remote cleared @46a111406564 (7 checks, current for 9417c7d380d0)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41573279179/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=46a111406564 tests=34498 skipped=70 runs=41573279179/1 profiles=ci-reuse/free-tests heads=9417c7d380d0 verified=2026-11-03T03:48:33.476Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "blocked",
    "scope": "docs/, README.md, AGENTS.md (read: docs/review-policy.md, docs/ship-policy.md, docs/skills.md, CLAUDE.md, CONTRIBUTING.md, ARCHITECTURE.md)",
    "exception": {
      "accepted_by": "GStack Minder (Captain)",
      "date": "2026-11-02",
      "via": "option A on #3906, relayed by the parent thread",
      "reason": "round-3 SCOPE_AUTH wording in docs/review-policy.md, the changelog fragment and the diff-scope comment, reviewed by fix-check p5, no third audit"
    }
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 3,
    "deferred": 0,
    "noted": 0,
    "fixed": 0,
    "scope": "frozen",
    "fix_checks": 5,
    "rounds": 6,
    "unrecorded": 3,
    "ledgers_read": 6
  }
}

What changed

GST-1036: a bare --base main reads origin/main, not a stale local main. Every review and ship bin that takes --base now resolves it through the resolver gstack-gate-diff already used, resolveBase in lib/gate-diff/git.ts. Two small helpers sit beside it: baseNote (the lag note gate-diff already printed, now shared) and baseArg (resolve the base, then print <bin>: <note> on stderr when the bin read another ref than the name).

  • gstack-review-plan: collectLive resolves through resolveBase. The plan prints REVIEW_BASE: <ref> <sha12>, --json carries base, and a lagging local base is named on stderr. The BASE_CONTAINS_HEAD check and the policy read use the same ref.
  • gstack-banned-terms, gstack-prose-lint --base, gstack-docs-candidate snapshot --base, gstack-design-detect.ts scan --changed and gstack-pr-shots --base (resolveCommit) now read origin's base.
  • A remote-qualified base (origin/main, upstream/main) still reads refs/remotes/<base> first, as on main. With no remote-tracking twin, the local branch still stands. One fringe case from main stays (see the open notes).

GST-1065: gstack-diff-scope no longer treats authorship files as auth. The *auth* glob matched author-spec.md and raised a docs bundle to gate class. Paths are now split the way lib/review-risk.ts tokens() splits them (camelCase, then non-alphanumerics). The match fails safe: any token containing auth raises the class unless the whole token is one of author, authors, authored, authoring, authorship, authority, authorities, coauthor or coauthors. So auth.ts, /auth/, authn, auth0, basicauth, useAuth.ts, nextauthmiddleware.ts, noauthrequired.ts, reauthn.ts, unauthenticated.ts and oauth2client.py raise it, and author-spec.md, AUTHORS, authority.ts and coauthors.ts do not.

docs/review-policy.md names the REVIEW_BASE: line and the new auth wording.

Why

GST-1036: #3882 planned a docs diff at full depth against a stale local main, about $1–2 extra on that PR. On main 14d7414 the review-plan diff itself was already origin-based (GST-883). Five sibling bins still merged against the local main and reported lines the branch only inherited, and review-plan never said which base it used. GST-1065: a docs bundle got four full readers, part of about 8M tokens (gstack-evals#158).

Blast radius

This touches merge-check classification, because SCOPE_AUTH feeds review depth. Docs about authors and authority no longer plan as gate class. Some names the old case-sensitive glob missed now raise SCOPE_AUTH (useAuth.ts, OAuthClient.ts, Authorize.tsx, AUTH_KEYS.md), which means more review, never less. The five bins now print a lag note on stderr when the local base differs from origin's. Security read: no network calls, secrets, permissions, workflows, install scripts or dependencies change.

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-11-03 Grant one scoped fix-check on #3906 for the mid-word auth gap (review_loop_grant bfcc898) “The Captain approved one fix round on #3906.” (GStack Minder (Captain, via parent)) approved one fix round and its one fix-check on #3906; findings after it ship as open notes none

Source: gstack-approvals record for capy/bare-base-reads-originbase (display only; not an approval citation).

Documentation

Scope: Read-only re-audit of attempt 1 (gsta202-docs-a1). I covered the diff 14d7414..HEAD (15 files, including 4399e40), plus committed, staged and unstaged state (the tree was clean). I also read the docs that mention the touched bins: docs/review-policy.md, docs/ship-policy.md, docs/skills.md, CLAUDE.md, CONTRIBUTING.md and ARCHITECTURE.md.

Result: Both corrections hold. The REVIEW_BASE line and --json base field in docs/review-policy.md match bin/gstack-review-plan. The SCOPE_AUTH row matches the token logic in bin/gstack-diff-scope. The other docs I checked refer to origin/ consistently, and none describes the old stale-local-base behavior, so nothing else needed edits. No files were edited.

Debt: None blocking. One optional wording nit: the auth row could say authorization still counts as auth. The installed gstack is 4 revisions behind latest.

Failing first

  • GST-1036: test/stale-local-base.test.ts and one case in test/gstack-design-detect.test.ts. On main 14d7414: 6 fail, 1 pass. After the fix: 7 pass.
  • GST-1065: test/diff-scope.test.ts path tables. On main: 8 of 20 fail (4 false positives, and 4 camelCase or upper-case names the case-sensitive glob missed). After: 20 pass. The granted round added 5 mid-word names, which fail at bfcc898 and pass at 712f5de.

Pre-Landing Review

The first pass ran at full depth (gate class) with 4 readers: a batched specialist, the red team, native adversarial and an outside voice (openai/gpt-6.1-sol).

  • Fixed in the first fix round (bfcc898). The word-only auth match dropped glued tokens such as auth0, basicauth and nextauth (specialist, INFORMATIONAL).
  • Fixed in the granted round (712f5de). Tokens with auth mid-word (unauthenticated, reauthentication, deauthorize, oauth2client, HTTPAuthorization) no longer set SCOPE_AUTH (outside voice and native adversarial, Medium, blocking). The grant named *oauth*. The arm uses oauth* on purpose, because *oauth* matched coauthors.ts, a GST-1065 negative control. A trailing oauth is still covered by *auth.
  • Captain option A (73a7267, 9417c7d). The auth match became the fail-safe exception list above, so nextauthmiddleware.ts, reauthn.ts and noauthrequired.ts now raise (they failed at 4399e40). The same round added a guard so resolveBase would not re-qualify origin/main to origin/origin/main. Its fix-check showed the guard returned null for a stacked base like alice/base when a remote named alice exists, so 9417c7d reverts it to main's behavior. The revert had its own fix-check under grant a-ba8597fc3f14.
  • Fix-checks. A fix-check followed each fix round. The fix-check on the 9-line docs fix that the Step 14.5 audit asked for (4399e40) ran because gstack-ship-release finish routes that doc as behavior. All three fix-checks after the auth fixes found nothing.

Open notes, not fixed:

  • gstack-pr-shots --base main resolves to the origin tip, not the merge base. If origin has moved and touched the same file, the before image shows upstream's newer text (native adversarial, Low).
  • gstack-docs-candidate snapshot --base <branch> by hand uses a two-dot diff against a moved origin tip. /ship passes a sha, so it isn't affected (native adversarial, Low).
  • In a fork setup (origin is a stale fork, upstream is canonical, local main is pulled from upstream), these bins now pick the stale origin/main, as gate-diff and review-plan already did on main. /ship treats origin as the PR's base repository (red team, INFORMATIONAL).
  • lib/review-risk.ts AUTH_PATH_TOKENS still needs an exact token, so glued names set SCOPE_AUTH without the targeted auth risk class. That file is pinned under the no-loss rule (fix-check, INFORMATIONAL). So the fail-safe reaches reviewer scoping (SCOPE_AUTH) but not that risk class for nextauthmiddleware.ts, noauthrequired.ts or basicauth.go (p5 fix-check, INFORMATIONAL).
  • On main and here, --base origin/main with refs/remotes/origin/main missing and refs/remotes/origin/origin/main present resolves to origin/origin/main through the origin twin lookup. The guard that fixed it regressed stacked bases and was reverted (Captain option A, pre-existing).
  • gstack-diff-scope's bash _resolve_base copy falls through the same way in that fringe case (p5 fix-check, INFORMATIONAL).
  • When resolveBase finds nothing, baseArg, collectLive and resolveCommit pass the raw name to git, which can read refs/tags/origin/main (p5 fix-check, INFORMATIONAL).

Documentation exception: accepted by GStack Minder (Captain) 2026-11-02 via option A on #3906, relayed by the parent thread: round-3 SCOPE_AUTH wording in docs/review-policy.md, the changelog fragment and the diff-scope comment, reviewed by fix-check p5, no third audit

Gate edits: none detected (gate scan tagged=0).

REVIEW_LOOP: passes=1 blocking_found=3 deferred=0 noted=0 fixed=0 scope=frozen unrecorded=3 ledgers_read=4 fix_checks=3. The three blockers come from the voices' ledger rows, and the summary can't pair them with a row: their text has no path:line it reads. Two are the mid-word auth gap, fixed at 712f5de. The third is the pr-shots note above, which the parser labeled CRITICAL although the reviewer marked it Low.

… diff-scope matches auth as a word (GST-1036, GST-1065)

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.

garrytan and others added 4 commits November 3, 2026 02:05
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…h; author* is not (review fix, GST-1065)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…e auth paths (granted fix round, GST-1065)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ST-1036, GST-1065)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
garrytan and others added 3 commits November 3, 2026 03:19
…mote-qualified base (GST-1065, GST-1036)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ked bases); fringe case stays an open note

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title fix(review): bare --base reads origin/<base> in review and ship bins; diff-scope matches auth as a word (GST-1036, GST-1065) v1.94.13.0 fix(review): bare --base reads origin/<base> in review and ship bins; diff-scope matches auth as a word (GST-1036, GST-1065) Nov 3, 2026
@capy-ai
capy-ai Bot merged commit d69ba2c 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