Use Garry Tan's exact Claude Code setup: 23 opinionated tools that serve as CEO, Designer, Eng Manager, Release Manager, Doc Engineer, and QA
TypeScript
v1.92.37.0 fix: review briefs check template slots before pasting reviewer text (GST-797) (#3797)
Garry Tan1ea86923a861
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex c92999f25..bacd0020f 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,5 +1,9 @@# Changelog+## [1.92.37.0] - 2026-11-01++- **A Red Team finding that quotes `origin/<base>` no longer stops `/ship`'s review** (`lib/review-brief.ts`, GST-797). The renderer checked each finished brief for unfilled slots like `<base>`, `<diff-base>` and `<exclude>` after the reviewers' findings and past learnings had been pasted in, so a finding that quoted one failed the render with `BRIEF_RENDER_FAILED: red-team: unfilled placeholder <base>` (seen on #3795). A quoted `<diff-base>` was also quietly swapped for the commit sha. The check now runs on the brief before that text goes in, and the quoted text reaches the reader exactly as written. A slot the section really leaves open still fails the render. A brief whose findings and learnings quote no slot name renders the same bytes as before.+## [1.92.36.0] - 2026-11-01**/ship's review collector keeps every severity label again, so a blocker named after "no CRITICAL issues except" is no longer lost.** v1.92.29.0 (GST-766) skipped any severity word that followed "no", "nothing", "none" and similar words, to stop a reviewer's closing line like "found nothing CRITICAL" from counting as a finding. That also threw away real blockers named in an exception clause: "No CRITICAL issues except the token leak in log.ts:3", "Nothing CRITICAL apart from the auth bypass (auth.ts:9)" and four more wordings collected nothing at all, so the gate never saw them. The collector now reads labels exactly as it did before v1.92.29.0. The reviewer's own Severity and Blocks fields are still recorded beside the label (`stated`), as in v1.92.29.0.diff --git a/VERSION b/VERSIONindex 188831bb6..1df70114c 100644--- a/VERSION+++ b/VERSION@@ -1 +1 @@-1.92.36.0+1.92.37.0diff --git a/agents-digest/gstack-AGENTS.md b/agents-digest/gstack-AGENTS.mdindex 7b4ef5af8..c41ccdba5 100644--- a/agents-digest/gstack-AGENTS.md+++ b/agents-digest/gstack-AGENTS.md@@ -1,4 +1,4 @@-# gstack digest v1.92.36.0 — regenerate/re-copy after upgrading gstack+# gstack digest v1.92.37.0 — regenerate/re-copy after upgrading gstackBehavioral rules from gstack (https://github.com/garrytan/gstack), compressedfor agent hosts without a full skill install. The full skills add workflows,diff --git a/docs/review-policy.md b/docs/review-policy.mdindex 7dddf25d7..6895500fa 100644--- a/docs/review-policy.md+++ b/docs/review-policy.md@@ -462,7 +462,11 @@ ones, and the arm lost blockers. `bin/gstack-review-dispatch` closes both ends:literal diff base, the plan's `DIFF_CMD` excludes, stack, test framework,learnings, checklist paths, the Red Team's merged findings and specialist count,and the outside voice's branch diff. A section that lost an anchor or placeholder- refuses (`BRIEF_RENDER_FAILED`) instead of rendering something else.+ refuses (`BRIEF_RENDER_FAILED`) instead of rendering something else, and so does+ a slot the section leaves unfilled (every reader but fix-check and the outside voice).+ That check runs before the findings and learnings go in, and they reach the reader+ as written, so a finding that quotes `origin/<base>` neither fails the render nor+ gets filled (GST-797).2. The dispatch program passes that file's content unchanged as the reader'sprompt and runs `sent` on what it passed: a hash that differs from the renderedone is `BRIEF_MISMATCH`, and that reader's review does not count.diff --git a/lib/review-brief.ts b/lib/review-brief.tsindex 67086d89e..fe1a3a5e7 100644--- a/lib/review-brief.ts+++ b/lib/review-brief.ts@@ -15,7 +15,7 @@* targeted classes, brief (review/specialists/targeted.md's text), checklist (its path), diff_base, stack, test_fw, learnings*/import { spawnSync } from 'node:child_process';-import { createHash } from 'node:crypto';+import { createHash, randomUUID } from 'node:crypto';import * as fs from 'node:fs';import * as path from 'node:path';import { renderFixCheckPrompt } from '../scripts/resolvers/fix-check';@@ -83,12 +83,21 @@ const SPECIALIST_DIFF = 'run\n`DIFF_BASE=<diff-base> && git diff "$DIFF_BASE" <econst PLACEHOLDERS = ['<diff-base>', '<exclude>', '<base>', '{checklist path}', '{STACK}', '{TEST_FW}', '{merged findings summary}', '{red-team checklist path}', '{learnings'];-/** Render one reader's brief. Throws BriefError on a missing slot, a section that no longer carries an anchor or placeholder, or a placeholder left unfilled. */+/**+ * Render one reader's brief. Throws BriefError on a missing slot, a section that no longer carries an anchor or placeholder, or a placeholder left unfilled.+ * Findings and learnings are reviewer text that may quote a slot name such as origin/<base> (GST-797): they render as a token, so the+ * placeholder check and the slot fills never see them, and go in last, trimmed as renderRole trims them. The token carries a+ * per-render nonce, so no other slot's text (a diff, a hunk) can name it.+ */export function renderBrief(role: BriefRole, slots: Slots, t: SectionTexts): string {- const text = renderRole(role, slots, t);+ const nonce = randomUUID();+ const keys = ['findings', 'learnings'].filter(k => slots[k]?.trim());+ const held: Slots = { ...slots };+ for (const k of keys) held[k] = `\u0000${nonce}:${k}\u0000`;+ const text = renderRole(role, held, t);const left = role === 'fix-check' || role === 'outside-voice' ? [] : PLACEHOLDERS.filter(p => text.includes(p));if (left.length) throw new BriefError(`${role}: unfilled placeholder ${left.join(', ')}`);- return text;+ return keys.reduce((out, k) => out.split(held[k]!).join(slots[k]!.trim()), text);}function renderRole(role: BriefRole, slots: Slots, t: SectionTexts): string {diff --git a/package.json b/package.jsonindex c6e216075..161b5cc27 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "gstack",- "version": "1.92.36",+ "version": "1.92.37","description": "Garry's Stack — Claude Code skills + fast headless browser. One repo, one install, entire AI engineering workflow.","license": "MIT","type": "module",diff --git a/test/review-dispatch.test.ts b/test/review-dispatch.test.tsindex 0dd5dcfd8..e1aa85d8d 100644--- a/test/review-dispatch.test.ts+++ b/test/review-dispatch.test.ts@@ -106,6 +106,48 @@ describe('gstack-review-dispatch render: briefs from the sections, slots only',expect(fs.readFileSync(field(r.stdout, 'file'), 'utf8')).toContain(`Read each checklist at ${lists} (tag each finding's`);expect(run(['render', '--role', 'specialist-batched', '--out', out, '--diff-base', SHA, '--checklists', 'testing,maintenance']).stderr).toContain('BRIEF_RENDER_FAILED: checklist not found');});++ // Value: protects=a finding or learning that quotes a slot name reaches its reader byte for byte instead of failing the render;+ // fails_when=the unfilled-slot check runs after findings or learnings are pasted in, or a later slot fill rewrites the pasted text+ // (#3795: a finding quoting `origin/<base>` failed with BRIEF_RENDER_FAILED: red-team: unfilled placeholder <base>);+ // why_new=GST-797; seam=lib/review-brief.ts renderBrief via gstack-review-dispatch render; no_claim=fix-check or outside-voice content+ test('findings and learnings that quote slot names render verbatim', () => {+ const quoted = ['[HIGH] bin/x.ts:4 runs `git merge-base origin/<base> HEAD` against a stale ref',+ '[MEDIUM] lib/y.ts:9 builds `DIFF_BASE=<diff-base> && git diff "$DIFF_BASE" <exclude>` by hand'].join('\n');+ const out = tmp();+ const w = (name: string, text: string) => { const f = path.join(out, name); fs.writeFileSync(f, text); return f; };+ const red = run(['render', '--role', 'red-team', '--out', out, '--diff-base', SHA, '--findings-file', w('findings.txt', `${quoted}\n`), '--specialists', '2']);+ expect(red.status, red.stderr).toBe(0);+ expect(fs.readFileSync(field(red.stdout, 'file'), 'utf8')).toContain(quoted);+ const spec = run(['render', '--role', 'specialist', '--name', 'testing', '--out', out, '--diff-base', SHA, '--exclude', "-- . ':(exclude)*.lock'", '--learnings-file', w('learnings.txt', quoted)]);+ expect(spec.status, spec.stderr).toBe(0);+ const brief = fs.readFileSync(field(spec.stdout, 'file'), 'utf8');+ expect(brief).toContain(`Past learnings: ${quoted}`);+ expect(brief).toContain(`git diff "$DIFF_BASE" -- . ':(exclude)*.lock'`);+ });++ // Value: protects=the unfilled-slot refusal still fires when a section really leaves a slot open, quoted findings or not;+ // fails_when=the GST-797 fix skips the check, or quoted content masks a real open slot; seam=lib/review-brief.ts renderBrief+ test('a slot the section really leaves open still refuses the render', () => {+ const t = sectionTexts(ROOT);+ const slots = { diff_base: SHA, checklist: '/x/red-team.md', specialists: '2' };+ const open = { ...t, redTeam: `${t.redTeam} Compare against origin/<base>.` };+ expect(() => renderBrief('red-team', slots, open)).toThrow(/^red-team: unfilled placeholder <base>$/);+ expect(() => renderBrief('red-team', { ...slots, findings: 'quotes `origin/<base>`' }, open)).toThrow(/^red-team: unfilled placeholder <base>$/);+ expect(() => renderBrief('specialist', { ...slots, name: 'testing', learnings: 'see <exclude>' }, { ...t, specialist: `${t.specialist} See <exclude>.` })).toThrow(/^specialist: unfilled placeholder <exclude>$/);+ });++ // Value: protects=a diff or hunk that carries NUL bytes reaches its reader unchanged and never pulls in another slot's text;+ // fails_when=renderBrief's put-back matches a token the caller can type, so a diff with \0learnings\0 splices the project's+ // learnings into the outside voice's brief and \0findings\0 crashes the render (GST-797 adversarial pass); seam=lib/review-brief.ts renderBrief+ test('reviewer text is put back only where the render held it', () => {+ const t = sectionTexts(ROOT);+ const diff = '+a \u0000learnings\u0000 b \u0000findings\u0000 c';+ const outside = renderBrief('outside-voice', { diff_base: SHA, diff, learnings: 'SECRET-LEARN', findings: 'F' }, t);+ expect(outside).toContain(diff);+ expect(outside).not.toContain('SECRET-LEARN');+ expect(renderBrief('fix-check', { fix_list: 'a.ts:3 fixed', hunks: diff, tests: '3 pass' }, t)).toContain(diff);+ });});describe('gstack-review-dispatch sent, collect, judge and verify: nothing changed on the way in or out', () => {