From 9b0a95d900f0fe1903c8399175c1ef839fc96684 Mon Sep 17 00:00:00 2001 From: ghost <49853598+JSONbored@users.noreply.github.com> Date: Thu, 18 Jun 2026 15:49:22 -0700 Subject: [PATCH] fix(preflight): redact private rerun hints from PR packet --- src/signals/local-branch.ts | 5 ++++- test/unit/local-branch.test.ts | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/signals/local-branch.ts b/src/signals/local-branch.ts index dc7ca7dba6..b2e5a9c703 100644 --- a/src/signals/local-branch.ts +++ b/src/signals/local-branch.ts @@ -1136,7 +1136,10 @@ function linkedIssueHygieneLines(branchEligibility: BranchEligibilityResult): st } function publicSafeRerunCondition(condition: string): string { - return /eligibility|multiplier|scoreability|score/i.test(condition) ? "Refresh linked issue and base branch metadata before submission." : condition; + if (/account\/queue maturity|pending PRs merge\/close|open PR count|projected score|threshold|eligibility|multiplier|scoreability|score/i.test(condition)) { + return "Rerun after any branch, base, or PR state changes before opening/submitting."; + } + return condition; } function branchFreshnessLines(freshness: LocalBranchAnalysis["baseFreshness"]): string[] { diff --git a/test/unit/local-branch.test.ts b/test/unit/local-branch.test.ts index 01eeb1171c..19f2e7c398 100644 --- a/test/unit/local-branch.test.ts +++ b/test/unit/local-branch.test.ts @@ -1259,6 +1259,15 @@ describe("local branch analysis", () => { expect(analysis.workspaceIntelligence.blockers.branchQuality).toEqual([]); expect(analysis.workspaceIntelligence.blockers.accountState.length).toBeGreaterThan(0); expect(analysis.recommendedRerunCondition).toBe("Rerun after account/queue maturity blockers clear."); + expect(analysis.prPacket.markdown).not.toMatch(/account\/queue maturity|account-state|score|credibility|Open PR count/i); + expect(analysis.prPacket.bodySections).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + heading: "Next Steps", + lines: expect.arrayContaining(["- Rerun after any branch, base, or PR state changes before opening/submitting."]), + }), + ]), + ); expect(analysis.nextActions[0]?.actionKind).not.toBe("land_existing_prs"); });