From 5db43c3f1250784bc6eff476a5e7f74207c07a43 Mon Sep 17 00:00:00 2001 From: iamnbutler Date: Thu, 22 Oct 2026 16:31:43 -0400 Subject: [PATCH 1/3] fix(host): match a channel's pull request only among the repository's own branches Why: apps/host/src/github.ts#function pull | gh --head matches a branch name in any fork; only same-repository pull requests are a channel's --- apps/host/src/github.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/host/src/github.ts b/apps/host/src/github.ts index 00690760..298642d9 100644 --- a/apps/host/src/github.ts +++ b/apps/host/src/github.ts @@ -416,15 +416,20 @@ const REVIEWS: Record = { REVIEW_REQUIRED: "required", }; -/** The newest pull request whose head is `branch`, or null when there is none. */ +/** + * The newest pull request from `branch` in the repository itself, or null when there is none. + * `--head` matches the branch name in any fork, and strangers open pull requests from their forks' + * `master` or `main`, so pull requests from other repositories never count as the channel's. + */ export async function pull(repo: string, branch: string): Promise { if (!branch || branch.startsWith("-")) throw new Error("Invalid branch name"); - const [value] = await gh< + const found = await gh< (Item & { isDraft: boolean; statusCheckRollup: Check[]; headRefOid: string; reviewDecision: string; + isCrossRepository: boolean; })[] >([ "pr", @@ -435,10 +440,11 @@ export async function pull(repo: string, branch: string): Promise !candidate.isCrossRepository); if (!value) return null; const review = REVIEWS[value.reviewDecision]; return { From f32f04e3c4897954086591836d6de96c80a789be Mon Sep 17 00:00:00 2001 From: iamnbutler Date: Thu, 22 Oct 2026 16:31:46 -0400 Subject: [PATCH 2/3] chore: record lane note for pull request matching --- ...JMZZF995AGBW0T463TMG57-gh-head-matches-a-branch-nam.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .lane/memory/apps/host/src/github.ts/01M5JMZZF995AGBW0T463TMG57-gh-head-matches-a-branch-nam.md diff --git a/.lane/memory/apps/host/src/github.ts/01M5JMZZF995AGBW0T463TMG57-gh-head-matches-a-branch-nam.md b/.lane/memory/apps/host/src/github.ts/01M5JMZZF995AGBW0T463TMG57-gh-head-matches-a-branch-nam.md new file mode 100644 index 00000000..6211f0a1 --- /dev/null +++ b/.lane/memory/apps/host/src/github.ts/01M5JMZZF995AGBW0T463TMG57-gh-head-matches-a-branch-nam.md @@ -0,0 +1,8 @@ +--- +id: 01M5JMZZF995AGBW0T463TMG57 +anchor: function pull +created: 2026-10-22T20:31:43Z +norm: '1' +--- + +gh --head matches a branch name in any fork; only same-repository pull requests are a channel's From 7f87faf486227aecfdd1a0e1f8e252d276a018ef Mon Sep 17 00:00:00 2001 From: iamnbutler Date: Thu, 22 Oct 2026 16:31:47 -0400 Subject: [PATCH 3/3] lane: sync fix-pr-branch memory --- ...01M5JMZZF995AGBW0T463TMG57-gh-head-matches-a-branch-nam.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.lane/memory/apps/host/src/github.ts/01M5JMZZF995AGBW0T463TMG57-gh-head-matches-a-branch-nam.md b/.lane/memory/apps/host/src/github.ts/01M5JMZZF995AGBW0T463TMG57-gh-head-matches-a-branch-nam.md index 6211f0a1..843a8d7c 100644 --- a/.lane/memory/apps/host/src/github.ts/01M5JMZZF995AGBW0T463TMG57-gh-head-matches-a-branch-nam.md +++ b/.lane/memory/apps/host/src/github.ts/01M5JMZZF995AGBW0T463TMG57-gh-head-matches-a-branch-nam.md @@ -3,6 +3,10 @@ id: 01M5JMZZF995AGBW0T463TMG57 anchor: function pull created: 2026-10-22T20:31:43Z norm: '1' +sig: 86063795bd4c903a +body_hash: 6bb86a7719dc73dc +raw_hash: e870bcc2d71cf57a +lines: 424-456 --- gh --head matches a branch name in any fork; only same-repository pull requests are a channel's