From 3b83032837392122fad47b5a6448142cc4b2ca63 Mon Sep 17 00:00:00 2001 From: garrytan Date: Thu, 15 Oct 2026 00:37:33 +0000 Subject: [PATCH] fix(pregate): --remote runs the gate only when local tests are selected (Lane C4) With only platform lanes selected, --remote no longer launches the remote gate with an empty file list; the existing no-local-lane path applies. Files (G2): lib/pregate/checks/lanes.ts. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- lib/pregate/checks/lanes.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pregate/checks/lanes.ts b/lib/pregate/checks/lanes.ts index 7968431ed..7b155af59 100644 --- a/lib/pregate/checks/lanes.ts +++ b/lib/pregate/checks/lanes.ts @@ -99,6 +99,7 @@ function unfinished(ctx: PregateContext, r: Awaited> const why = r.runs.find(x => x.outcome === 'spawn-failed') ? 'the runner could not be launched' : `local lane timed out after ${ctx.timeoutMs} ms`; return { code: 'PREGATE_INCOMPLETE', detail: `${why} (${total} files${rest})`, fix: 'raise --timeout or split the selection; a timed-out lane never passes' }; } + function describe(sel: Selection): string[] { const lines = sel.noLane.map(f => `FAIL lanes — ${f} has no test lane`); for (const r of sel.remote) lines.push(`requires-remote ${r.lane} (${r.platform}): ${r.tests.length} test(s) — ${r.tests.slice(0, 8).join(' ')}${r.tests.length > 8 ? ' …' : ''}`); @@ -172,7 +173,7 @@ async function run(ctx: PregateContext): Promise { return { ...base, status: 'fail', code: 'PREGATE_NO_LANE', detail: `${sel.noLane.length} touched file(s) with no test lane: ${sel.noLane.join(' ')}`, fix: 'add a test that names the file, or declare its lane (or []) under dependencies in .gstack/pregate.json' }; } if (sel.tests.length === 0) return { ...base, detail: ctx.touched.length ? 'nothing touched selects a test' : 'no touched files' }; - if (ctx.remote) return runRemote(ctx, sel, base); + if (ctx.remote && sel.localTests.length) return runRemote(ctx, sel, base); const smallMachine = ctx.cores < SMALL_MACHINE_CORES && sel.localTests.length > 0 && (ctx.config.remote_gate || ctx.testBackend !== 'local'); if (smallMachine) { const obligation = remoteObligation(ctx, sel);