Skip to content

Commit 1b044d6

Browse files
authored
Merge pull request #27 from getBoolean/sync/upstream-2026-11-15
chore: sync upstream (2026-11-15)
2 parents a0a3f1f + ed69367 commit 1b044d6

1,226 files changed

Lines changed: 54287 additions & 8829 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/fork-manifest.txt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ apps/mobile/src/native/NativeScrollViewMarker.tsx export function renderNativeSc
337337
# Fork: legacy iPad navigation preserves sidebar destinations and native pop state.
338338
apps/mobile/src/native/createV5StackNavigator.ios.tsx Fork:
339339
apps/mobile/src/native/createV5StackNavigator.ios.tsx deviceType === "pad",
340+
apps/mobile/src/native/createV5StackNavigator.ios.test.tsx Fork:
341+
apps/mobile/src/native/createV5StackNavigator.ios.test.tsx vi.mock("./native-layout-metrics"
340342

341343
# Fork: preserve iPad Settings detail projection and native Back reconciliation.
342344
apps/mobile/src/native/workspace-stack-projection.test.ts Fork:
@@ -745,7 +747,7 @@ packages/source-control-azure-devops/src/server/AzureDevOpsCli.test.ts Effect.pr
745747

746748
# Fork: Use the project account credential for forge requests instead of the machine login; preserve account-scoped authorization and commit identity.
747749
packages/source-control-azure-devops/src/server/AzureDevOpsCli.ts Fork:
748-
packages/source-control-azure-devops/src/server/AzureDevOpsCli.ts Effect.flatMap(Effect.service(SourceControlHost.AccountCredential), (account) =>
750+
packages/source-control-azure-devops/src/server/AzureDevOpsCli.ts const account = yield* Effect.service(SourceControlHost.AccountCredential);
749751

750752
# Fork: Use the project account credential for forge requests instead of the machine login; preserve account-scoped authorization and commit identity.
751753
packages/source-control-bitbucket/src/server/BitbucketApi.test.ts Fork:

‎.github/scripts/pr-limits.cjs‎

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,22 @@ function parseExemptions(text) {
100100
}
101101

102102
// VOUCHED.td: one `github:login` per line, `#` comments, and `-github:login reason` to denounce.
103-
function vouchedLogins(text) {
104-
const logins = new Set();
103+
// A login listed both ways is an error: pr-vouch.yml's action reads its first line and
104+
// issue-vouch.yml its last, so no answer here would agree with both labels.
105+
function parseVouchList(text) {
106+
const vouched = new Set();
107+
const denounced = new Set();
105108
for (const raw of text.split("\n")) {
106-
const entry = raw.trim().split(/\s+/)[0];
107-
if (entry.startsWith("github:")) logins.add(entry.slice("github:".length).toLowerCase());
109+
const match = /^(-?)github:(\S+)/.exec(raw.trim());
110+
if (!match) continue;
111+
const login = match[2].toLowerCase();
112+
const [listed, other] = match[1] ? [denounced, vouched] : [vouched, denounced];
113+
if (other.has(login))
114+
throw new Error(`${VOUCHED_PATH}: ${login} is both vouched and denounced`);
115+
listed.add(login);
108116
}
109-
if (logins.size === 0) throw new Error(`${VOUCHED_PATH}: no entries`);
110-
return logins;
117+
if (vouched.size === 0) throw new Error(`${VOUCHED_PATH}: no entries`);
118+
return { vouched, denounced };
111119
}
112120

113121
function labeledAt(pr, name) {
@@ -278,7 +286,8 @@ async function enforceOpenLimit({ github, context, core, dryRun }) {
278286
// lookups as "not vouched". Every read below throws on failure, and a throw closes nothing.
279287
if (pr.user.type === "Bot") return;
280288
if (parseExemptions(fs.readFileSync(EXEMPTIONS_PATH, "utf8")).has(author.toLowerCase())) return;
281-
if (vouchedLogins(fs.readFileSync(VOUCHED_PATH, "utf8")).has(author.toLowerCase())) return;
289+
const { vouched, denounced } = parseVouchList(fs.readFileSync(VOUCHED_PATH, "utf8"));
290+
if (vouched.has(author.toLowerCase())) return;
282291
const { data: access } = await github.rest.repos.getCollaboratorPermissionLevel({
283292
...context.repo,
284293
username: author,
@@ -289,6 +298,21 @@ async function enforceOpenLimit({ github, context, core, dryRun }) {
289298
const reopened = context.payload.action === "reopened";
290299
if (reopened && context.payload.sender.login.toLowerCase() !== author.toLowerCase()) return;
291300

301+
if (denounced.has(author.toLowerCase())) {
302+
if (dryRun) {
303+
core.notice(`Dry run. PR #${pr.number} would close: ${author} is denounced.`);
304+
return;
305+
}
306+
await closeWithComment(
307+
github,
308+
context,
309+
pr.number,
310+
`Closing: ${author} is banned from contributing here, so this PR will not be reviewed. See [bans](${guideLink(context, "bans")}).`,
311+
);
312+
core.info(`PR #${pr.number}: closed, ${author} is denounced.`);
313+
return;
314+
}
315+
292316
const q = `repo:${context.repo.owner}/${context.repo.repo} is:pr is:open author:${author} sort:created-asc`;
293317
const { search } = await read(github, AUTHOR_OPEN_PRS_QUERY, { q });
294318
// A new PR counts only the older ones, so two opened together cannot close each other.

‎.github/workflows/issue-vouch.yml‎

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,14 @@ jobs:
4040
ref: context.payload.repository.default_branch,
4141
});
4242
const statusByUser = new Map();
43+
const listedBothWays = new Set();
4344
for (const raw of Buffer.from(file.content, "base64").toString("utf8").split("\n")) {
4445
const match = /^(-?)github:(\S+)/.exec(raw.trim());
45-
if (match) statusByUser.set(match[2].toLowerCase(), match[1] ? "denounced" : "vouched");
46+
if (!match) continue;
47+
const login = match[2].toLowerCase();
48+
const status = match[1] ? "denounced" : "vouched";
49+
if (statusByUser.has(login) && statusByUser.get(login) !== status) listedBothWays.add(login);
50+
statusByUser.set(login, status);
4651
}
4752
4853
const issues =
@@ -74,4 +79,32 @@ jobs:
7479
await github.rest.issues.addLabels({ owner, repo, issue_number: issue.number, labels: [next] });
7580
core.info(`Issue #${issue.number} (${issue.user.login}): ${status} -> ${next}`);
7681
}
82+
83+
// Only a newly opened issue is closed. One filed before its author was denounced
84+
// may already have a fix on the way, so the sweep leaves those to maintainers.
85+
// Someone else reopening it is a maintainer keeping it open.
86+
const reopenedByOther =
87+
context.payload.action === "reopened" &&
88+
context.payload.sender.login.toLowerCase() !== issue.user.login.toLowerCase();
89+
// The PR rules refuse a list that names a login both ways, so nothing closes for one here.
90+
const trusted =
91+
issue.user.type === "Bot" ||
92+
["OWNER", "MEMBER", "COLLABORATOR"].includes(issue.author_association) ||
93+
listedBothWays.has(issue.user.login.toLowerCase());
94+
if (status === "denounced" && context.eventName === "issues" && !reopenedByOther && !trusted) {
95+
await github.rest.issues.createComment({
96+
owner,
97+
repo,
98+
issue_number: issue.number,
99+
body: `Closing: ${issue.user.login} is banned from contributing here, so this issue will not be triaged. See [bans](https://github.com/${owner}/${repo}/blob/main/CONTRIBUTING.md#bans).`,
100+
});
101+
await github.rest.issues.update({
102+
owner,
103+
repo,
104+
issue_number: issue.number,
105+
state: "closed",
106+
state_reason: "not_planned",
107+
});
108+
core.info(`Issue #${issue.number}: closed, ${issue.user.login} is denounced.`);
109+
}
77110
}

‎CONTRIBUTING.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ the open PR limit.
115115
- If you make our lives harder as reviewers and maintainers, you will be banned. Examples are repeated
116116
pings, a fight over a closure, and a second account to get around a limit.
117117

118+
A banned account is denounced in [.github/VOUCHED.td](.github/VOUCHED.td). Any issue or PR it opens
119+
is closed when it is opened.
120+
118121
<a id="closure-and-reconsideration"></a>
119122

120123
## When your PR is closed

‎apps/desktop/src/app/CodexAuthCallback.test.ts‎

Lines changed: 53 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,27 @@ function callback(authorizationUrl: string) {
3737
}
3838

3939
describe("desktop Codex callback helper", () => {
40-
it("binds before opening sign-in, ignores a foreign response, and returns only the code callback", async () => {
40+
it("binds before opening sign-in, ignores a foreign response, and returns only the code callback", async ({
41+
onTestFinished,
42+
}) => {
4143
const authorizationUrl = request(await freePort());
4244
const expected = callback(authorizationUrl);
43-
const received = await receiveCodexAuthCallback(authorizationUrl, async () => {
45+
const opening = Promise.withResolvers<boolean>();
46+
onTestFinished(() => opening.resolve(true));
47+
const checkResponse = async () => {
4448
const invalid = new URL(expected);
4549
invalid.searchParams.set("state", "foreign");
4650
expect((await fetch(invalid)).status).toBe(400);
4751
const response = await fetch(expected);
4852
expect(response.headers.get("cache-control")).toBe("no-store");
4953
expect(await response.text()).not.toContain("test-code");
50-
return true;
54+
};
55+
let responseChecked!: Promise<void>;
56+
const received = await receiveCodexAuthCallback(authorizationUrl, () => {
57+
responseChecked = checkResponse();
58+
return responseChecked.then(() => opening.promise);
5159
});
60+
await responseChecked;
5261
expect(received).toBe(expected);
5362
});
5463
it("returns hosted web to the exact instance and environment without putting the code in its query", async () => {
@@ -61,34 +70,52 @@ describe("desktop Codex callback helper", () => {
6170
instanceId: ProviderInstanceId.make("work"),
6271
flowId: "flow-one",
6372
};
73+
const openBrowser = async () => {
74+
const response = await fetch(expected, { redirect: "manual" });
75+
expect(response.status).toBe(303);
76+
const delivery = response.headers.get("location")!;
77+
expect(new URL(delivery).searchParams.has("code")).toBe(false);
78+
expect(readCodexAuthDelivery(delivery)?.callbackUrl).toBe(expected);
79+
expect(readCodexAuthDelivery(delivery)?.returnUrl).toBe(input.returnUrl);
80+
return true;
81+
};
82+
let opening!: Promise<boolean>;
6483
await receiveCodexAuthCallback(
6584
authorizationUrl,
66-
async () => {
67-
const response = await fetch(expected, { redirect: "manual" });
68-
expect(response.status).toBe(303);
69-
const delivery = response.headers.get("location")!;
70-
expect(new URL(delivery).searchParams.has("code")).toBe(false);
71-
expect(readCodexAuthDelivery(delivery)?.callbackUrl).toBe(expected);
72-
expect(readCodexAuthDelivery(delivery)?.returnUrl).toBe(input.returnUrl);
73-
return true;
74-
},
85+
() => (opening = openBrowser()),
7586
(url) => codexAuthDeliveryUrl(input, url),
7687
);
88+
await opening;
7789
});
78-
it("cancels and releases its listener so exact-port reauthorization can run again", async () => {
79-
const authorizationUrl = request(await freePort());
80-
await expect(
81-
receiveCodexAuthCallback(authorizationUrl, async () => {
82-
cancelCodexAuthCallback(authorizationUrl);
83-
return true;
84-
}),
85-
).rejects.toThrow("cancelled");
86-
expect(
87-
await receiveCodexAuthCallback(authorizationUrl, async () => {
88-
await fetch(callback(authorizationUrl));
89-
return true;
90-
}),
91-
).toBe(callback(authorizationUrl));
90+
it("cancels and releases its listener so exact-port reauthorization can run again", async ({
91+
onTestFinished,
92+
signal,
93+
}) => {
94+
for (const external of [false, true]) {
95+
const authorizationUrl = request(await freePort());
96+
const abort = new AbortController();
97+
const opening = Promise.withResolvers<boolean>();
98+
onTestFinished(() => opening.resolve(true));
99+
await expect(
100+
receiveCodexAuthCallback(
101+
authorizationUrl,
102+
async () => {
103+
if (external) abort.abort();
104+
else cancelCodexAuthCallback(authorizationUrl);
105+
return opening.promise;
106+
},
107+
undefined,
108+
abort.signal,
109+
),
110+
).rejects.toThrow("cancelled");
111+
if (signal.aborted) return;
112+
expect(
113+
await receiveCodexAuthCallback(authorizationUrl, async () => {
114+
await fetch(callback(authorizationUrl));
115+
return true;
116+
}),
117+
).toBe(callback(authorizationUrl));
118+
}
92119
});
93120
it("allows two accounts to complete independently", async () => {
94121
const a = request(await freePort(), "a".repeat(43));

‎apps/desktop/src/app/DesktopApp.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,9 @@ const bootstrap = Effect.fn("desktop.bootstrap")(function* (backendStarted: bool
308308
}
309309

310310
const primaryBackend = yield* (yield* DesktopBackendPool.DesktopBackendPool).primary;
311-
// WSL-only fallback can change the primary endpoint before readiness.
312311
const config = yield* primaryBackend.currentConfig;
313312
if (
314313
!environment.isDevelopment &&
315-
!settings.wslOnly &&
316314
Option.isSome(config) &&
317315
Option.isNone(config.value.preflightFailure)
318316
) {

‎apps/desktop/src/app/DesktopClerk.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,12 @@ export const make = Effect.gen(function* () {
178178
Effect.gen(function* () {
179179
yield* electronApp.whenReady;
180180
yield* Effect.tryPromise({
181-
try: () =>
181+
try: (signal) =>
182182
receiveCodexAuthCallback(
183183
request.authorizationUrl,
184184
(url) => runPromise(shell.openExternal(url)),
185185
(callbackUrl) => codexAuthDeliveryUrl(request, callbackUrl),
186+
signal,
186187
),
187188
catch: () =>
188189
new CodexAuthCallbackError({

‎apps/desktop/src/app/DesktopConnectionCatalogStore.test.ts‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,4 +300,66 @@ describe("DesktopConnectionCatalogStore", () => {
300300
assert.deepStrictEqual(yield* store.get, Option.some('{"schemaVersion":1,"targets":[]}'));
301301
}).pipe(Effect.provide(NodeServices.layer)),
302302
);
303+
304+
const emptyCatalog =
305+
'{"schemaVersion":1,"targets":[],"profiles":[],"credentials":[],"remoteDpopTokens":[],"disabledEnvironmentIds":[]}';
306+
const savedFilesHolding = Effect.fn(function* (stateDir: string, contents: string) {
307+
const fileSystem = yield* FileSystem.FileSystem;
308+
const path = yield* Path.Path;
309+
const kept: string[] = [];
310+
for (const name of yield* fileSystem.readDirectory(stateDir)) {
311+
const file = path.join(stateDir, name);
312+
if ((yield* fileSystem.stat(file)).type !== "File") continue;
313+
if ((yield* fileSystem.readFileString(file)) === contents) kept.push(name);
314+
}
315+
return kept;
316+
});
317+
318+
it.effect("keeps a catalog this build cannot decode when the next save replaces it", () =>
319+
withStore(
320+
Effect.gen(function* () {
321+
const path = yield* Path.Path;
322+
const environment = yield* DesktopEnvironment.DesktopEnvironment;
323+
const fileSystem = yield* FileSystem.FileSystem;
324+
const store = yield* DesktopConnectionCatalogStore.DesktopConnectionCatalogStore;
325+
const catalogPath = path.join(environment.stateDir, "connection-catalog.json");
326+
assert.isTrue(
327+
yield* store.set(
328+
'{"schemaVersion":1,"targets":[{"_tag":"FutureConnectionTarget","environmentId":"remote"}],"profiles":[],"credentials":[],"remoteDpopTokens":[],"disabledEnvironmentIds":[]}',
329+
),
330+
);
331+
const original = yield* fileSystem.readFileString(catalogPath);
332+
333+
yield* store.get;
334+
assert.isTrue(yield* store.set(emptyCatalog));
335+
336+
assert.isNotEmpty(yield* savedFilesHolding(environment.stateDir, original));
337+
}),
338+
),
339+
);
340+
341+
it.effect("keeps a catalog that no longer decrypts when the next save replaces it", () =>
342+
Effect.gen(function* () {
343+
const path = yield* Path.Path;
344+
const fileSystem = yield* FileSystem.FileSystem;
345+
const baseDir = yield* fileSystem.makeTempDirectoryScoped({
346+
prefix: "t3-desktop-connection-catalog-test-",
347+
});
348+
const failDecrypt = yield* Ref.make(false);
349+
const store = yield* DesktopConnectionCatalogStore.DesktopConnectionCatalogStore.pipe(
350+
Effect.provide(layerFor(baseDir, true, failDecrypt)),
351+
);
352+
const stateDir = path.join(baseDir, "userdata");
353+
assert.isTrue(yield* store.set('{"schemaVersion":1,"targets":[]}'));
354+
const original = yield* fileSystem.readFileString(
355+
path.join(stateDir, "connection-catalog.json"),
356+
);
357+
358+
yield* Ref.set(failDecrypt, true);
359+
yield* store.get.pipe(Effect.flip);
360+
assert.isTrue(yield* store.set(emptyCatalog));
361+
362+
assert.isNotEmpty(yield* savedFilesHolding(stateDir, original));
363+
}).pipe(Effect.provide(NodeServices.layer), Effect.scoped),
364+
);
303365
});

0 commit comments

Comments
 (0)